From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

excel will not close using activeX

I have been reading a ton of the responses on the forums regarding this issue and I seem to have everything correct (obviously not since I cant get it to work).  I cant find the reference that is causing excel.exe to remain in memory after I run the vi.

I have used the highlight execution and there are no errors passed through anywhere, so it is going through all the closes and the application quit.

Can someone see if I made a mistake somewhere.

Here is a description of the open and closes:

Open Application ref
Open workboos
open _workbook
Close Workbooks
Open Worksheet
open range
open rows
open columns
close columns
close rows
close range
close worksheet
close _workbook
application quit
close application

thanks

Kenny
Kenny

Message 1 of 3
(7,321 Views)

Hello Kenny,

It looks like you have definately closed all of the references and used the quit method.  However, you normally need to close references in the reverse order that you close them.  You seem to close a reference to the workbooks before closing the reference to more specific parts of the spread sheet.  Try moving the close reference to be in the correct order.  This knowledgebase has a small example to start testing.

http://digital.ni.com/public.nsf/websearch/D9B5637D23FD98D2862570A100638EF3?OpenDocument

Also make sure that you call the methods that will explicitely close the workbooks and worksheets.

Steven T.

Message 2 of 3
(7,309 Views)
A useful tool is to check each error output for errors.  This can generally tell you if you've closed references out of order.

Note that any function which returns a reference opens a new reference (Ranges need to be closed too).

Are you sure no other component is causing the problem.  What happend when you simply open and close excel?  Then add one step at a time to see where the problem is.

I can't look at your code, so my reply has to remain kind of fuzzy.

Sorry

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 3 of 3
(7,301 Views)