LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW 2021 Cannot Save Word Document from Report (But can create excel or HTML)

I have a c:\temp directory on my computer.  I'm trying to run the dirt simple VI which creates a report (either Word, Excel, or HTML).  When I run it as a "Word", a save prompt comes up.  Yes, I can type the path and filename at the prompt and it does save, but that is not how the program is supposed to work.  In addition to this, I get an error code (-2146824090)

 

Exception occured in Microsoft Word: Command failedHelp Path is wdmain11.chm and context 36966 in NI_ReportGenerationToolkit.lvlib:Word_Save_Document.vi->NI_Word.lvclass:Save Report to File.vi->CreateAndSaveReport.vi

 

When I run the VI as Excel or HTML, the file gets created perfectly.

0 Kudos
Message 1 of 3
(189 Views)

The program is failing at the first RGT function, Create Report.  I've not used the RGT with Word recently, so I'm uncertain how to fix this bug.  I can tell you that it happens right at the tail end of NI_Word.lvclass:Create Report.vi, when it calls a sub-VI called NI_Word.lvclass:new report subVI.  The very first thing that happens in there is LabVIEW tries to execute an Automation Open function with argument Word._Application and a string "machine name (empty)" (which I think is, in fact, an empty string).  This spits out a long Error number, which kills everything "downstream".

 

Bob Schor

0 Kudos
Message 2 of 3
(154 Views)

I have 2018 and the code works fine after I recreated your VI.

From 2018, here is the section of code in the VI that Bob is referring to. 
Maybe the Word._Application needs to be relinked to the ActiveX object? 

Have you checked the RGT Toolkit's compatibility with your Office and Windows version?

It's strange that it works for Excel but not Word. 

Have you opened Word separately from LabVIEW? If this is a fresh install of Office, a dialog could be blocking the execution of your program. 

aputman_0-1732552809517.png

 

aputman
0 Kudos
Message 3 of 3
(137 Views)