LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Close Excel

Hi,
I have an application where i open an excel worksheet using report generation toolkit. as read in NIs' discussion forum, i have attached a boolean (True) for open new instance in new report.vi. this is working fine, mean it opens a new excel instance everytime in Labview. But when i build the same applications EXE, the excel does not get closed. the user can open the excel worksheet 3-4 times and then it hangs. i know the problem, that excel is not being closed. can u suggest me the appropriate. i do not want to use dispose.vi, because using that closes the excel worksheet, whereas my user needs it for analysis after closing my application.
Regards,
Kinnary.
0 Kudos
Message 1 of 12
(6,134 Views)
Why not just set "open new instance" to "False". This should fix the problem just like that.

>edited : addted text<

I'm also not sure what you mean by needing the worksheet after closing the application. Are you saving the worksheet at all? This is the only way to make the worksheet available after closing the application (excel). Or do you mean that you want to leave Excel open with the worksheet in it after closing your LV application?

Shane.

Message Edited by shoneill on 03-18-2005 09:32 AM

Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 2 of 12
(6,125 Views)
Hi Shane,
I want to keep my excel open even after quitting the LabView Application. if i make the open instance as false... the same thing happens (it hangs) even during normal LabView application. my problem is that - if things are working fine using Labview, then why do they fail when i build its EXE? they should work the way they work during design time, right?
Regards,
Kinnary.
0 Kudos
Message 3 of 12
(6,125 Views)
Modify the Excel case in the "Dispose Report.vi" and give it a try.

-Joe
0 Kudos
Message 4 of 12
(6,117 Views)
Hi Joe,
Can you please elaborate a bit more.
Regards,
Kinnary.
0 Kudos
Message 5 of 12
(6,104 Views)
Everytime when an Excel activex automation is opened, it needs to be properly closed. If your vi opened excel but without either closing it or disposing its reference, it will hang in the memory (sometimes you may even notice when you double click on an excel file in explorer and you see only the title bar and toolbars but the working area is transparent. you will also see multiple excel references reside in the memory. The image showed a way to close the automation reference only and leave Excel open.

It seems NI updated the "Dispose Report.vi", however, I noticed the order of closing references are not what they should be. The correct order should be: shapes, _worksheet, Sheets, _workbook, _Application.

-Joe
Message 6 of 12
(6,089 Views)
Hi,
Can you please give me the full view of the snap7.gif meaning, the whole dispose report.vi with modification. PLEASE.
Regards,
Ms Kinnary.
0 Kudos
Message 7 of 12
(5,983 Views)
here are the pictures of the vi I modified, both cases are presented (snap1 disploses ref only, snap2 quits excel).

-Joe
0 Kudos
Message 8 of 12
(5,960 Views)
sorry, fogot the pictures
Message 9 of 12
(5,959 Views)
Message 10 of 12
(5,957 Views)