LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

opening excel file with active x closes already open excel app

I am experiencing an odd thing in that Excel 2007 when open with a spreadsheet file open in it ...it gets clobbered when I run my labview app that simply opens an excel file and reads it in.  The existing excel app gets completely closed.  Any body know why this can occur?

0 Kudos
Message 1 of 8
(3,840 Views)

Hello,

 

It depends on how you close the references at the end of your VI.  For instance in this example it closes the Worksheet, then the Workbook, and then the Excel Application at the end of the VI.  In this specific example it is expected to close the Excel Application by the last Close Reference function.

 

Capture.PNG

Regards,

M. Whitaker
ni.com/support
0 Kudos
Message 2 of 8
(3,796 Views)

thanks but doesnt the application quit method actually close down excel? If you were to close the ref to the application without invoking the quit method, would ther be a problem?

0 Kudos
Message 3 of 8
(3,780 Views)

Yes, the Quit Method is the specific function that closes down the Excel program.  I do not see any issues with getting rid of the Quit Method, but leaving the Close Application as that will close the necessary reference in LabVIEW.

Regards,

M. Whitaker
ni.com/support
0 Kudos
Message 4 of 8
(3,764 Views)

I discovered a problem today that the closing of excel down only occurs when running the exe and not the IDE version.  Here is my code.

0 Kudos
Message 5 of 8
(3,732 Views)

I ran the program as a VI and as an EXE, however on my system neither way caused Excel to close.  What is currently open in Excel when you run the VI and it closes Excel?

Regards,

M. Whitaker
ni.com/support
0 Kudos
Message 6 of 8
(3,713 Views)

Any excel file.  I have Excel 2010 on Win7.  I have also seen this on other machines with hte same load at my work with the exe. .

0 Kudos
Message 7 of 8
(3,709 Views)

In your application if you disable your last "Close Reference.vi" does Excel still close in the executable?

Regards,

M. Whitaker
ni.com/support
0 Kudos
Message 8 of 8
(3,694 Views)