LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I find out that Excel was closed in the "x"

When using Excel from CVI Active X controls, is there any way that I can find out that a user closed Excel using the "x" in the right top corner of Excel? When this happens I loose control of Excel and I can'f find out if Excel is still running because all handles are still valid.
0 Kudos
Message 1 of 2
(2,759 Views)
I am assuming that you are launching Excel as an out-of-process server through ActiveX automation and not using it as an ActiveX control in your CVI panel (I am not sure Excel can be embedded as an ActiveX control). If this is the case, when the user closes Excel using the 'x' close button, Excel will continue to run as long as your CVI program (the ActiveX client) has open handles and has not called 'Excel_AppQuit'. You can detect this by getting the Visible property of the Application object (Excel_AppVisible) - the value should be VFALSE. You can also detect if an interactive user is using Excel or not by getting the UserControl property of the Application object.

Hope this helps.
Best regards,
Mohan
0 Kudos
Message 2 of 2
(2,759 Views)