LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel ActiveX Closing Workbook Problem

I did some searching and have found a few examples on this topic, but am still having trouble with closing the excel application after it has finished reading the data in. (It stays open in the background). I believe the Application.Quit should work, but there are still errors and excel stays open. I have attached the sample VI that I am working with. Would someone be able take a second look or give some advice? Thanks

 

0 Kudos
Message 1 of 4
(3,116 Views)

Well, I use the Report Generation Toolkit and avoid ActiveX.  Here's how I would do this:

Read Excel.png

I open your file as a New Report, using Excel.  I "Get Data" from cell A2 to cell M16 as a 2D array of strings, then I Dispose Report, which closes Excel.  This suggests to me that perhaps there is a Close ActiveX command that you should use instead of Application Quit.

 

Bob Schor

0 Kudos
Message 2 of 4
(3,064 Views)

Hi

 

It looks as if You're closing the Application reference before You use it on the Quit Application Invoke.

The Application reference branches in the beginning, and is fed to the last close reference node right before the Quit invoke node.

 

Hope it helps. 🙂

Don't forget to rate a good Answer....
---------------------------------------------------------
Here should be some cool signature

But there's NOT

LabVIEW 2012-2017
---------------------------------------------------------
Message 3 of 4
(3,047 Views)

Hi again.

 

I've just tested the VI You uploaded, and found out that my Excel application didn't close as well.

I then expanded the first Application property node and added the property "Display Alerts", and wired a False Constant to it. This prevents the "Do You want to save Your Changes" dialog from popping up, which in turn prevents Excel form closing.

PropertyNode.png

Hope it helps.

Don't forget to rate a good Answer....
---------------------------------------------------------
Here should be some cool signature

But there's NOT

LabVIEW 2012-2017
---------------------------------------------------------
0 Kudos
Message 4 of 4
(3,035 Views)