From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

closing word table doesnt work

Solved!
Go to solution

I am having difficulty with the active x progrmaming with MS Word.  My VI simply runs thru a directory and opens each word document and converts it to text and accumulates it into an array.  My problem is that MS word does not close each file after loading it in each iteration.  What am I doing wrong? 

0 Kudos
Message 1 of 5
(2,922 Views)
Solution
Accepted by tst

Use the _Document Close method as the last thing in the FOR loop (close the document reference after). Also you should get the Documents collection only once BEFORE the FOR loop and close this reference first thing after the FOR loop. Before closing the _Application reference you could use the  Quit method to close Word and then close the _Application reference.

 

Ben64

Message 2 of 5
(2,917 Views)

Since you are using LabVIEW 2014, have you considered using the Report Generation Toolkit functions instead of ActiveX?  I don't have as much experience using the Word functions, but I've done a lot with Excel and have also used them to generate HTML Reports.  Very simple, well-documented, fewer "hidden tricks" ...

 

Bob Schor

0 Kudos
Message 3 of 5
(2,894 Views)
Solution
Accepted by topic author id

Ben You saved me a lot of headaches as usual.  Thanks.  It works Kudos!

0 Kudos
Message 4 of 5
(2,843 Views)

@id wrote:

Ben You saved me a lot of headaches as usual.  Thanks.  It works Kudos!


Then you should mark my post as the the accepted soluton Smiley Happy

 

Ben64

0 Kudos
Message 5 of 5
(2,833 Views)