10-30-2014 12:47 AM
I am working with report generation toolkit.
Before generating the report I'm trying to close all the excel sheets using Active X. At times the excel application gets closed without asking for the save or dont save option.
What change should I do in the code?
Please find the attached code
Solved! Go to Solution.
10-30-2014 03:52 PM
If you are working with the Report Generation Toolkit, are using a fairly recent version of LabVIEW (say 2010 or later), and have opened an Excel Report, you should not be using ActiveX to close it (you should try to not use ActiveX for anything unless there is no alternative). Instead, use the Save Report and Dispose Report functions.
There is, however, an interesting bug in Dispose Report -- if you "manually" close the Excel spreadsheet and stop Excel before LabVIEW does its Dispose, LabVIEW will actually "dispose" of your saved report! Here's one place where I use ActiveX to guard against this bug -- I check that Excel is still running before I use Dispose Report.
BS
10-30-2014 06:05 PM
I think you need th set the DisplayAlerts property to TRUE.
10-31-2014 12:58 AM
Hi,
Thanks for the help.
The VI is still not consistent at times. It closes without saving even if I'm using display alerts. I'm also getting an error when i keep running the code. And I think the error is because the excel sheet is maximised and I'm running the code. Please find the attached snapshot of the error.
Regards
Hridhya
10-31-2014 03:42 AM