05-14-2012 02:12 PM
I just tried on another pc with XP, Excel2007 and LV2010SP1.
No error. Excel closed before VI stop.
Are you using his version or mine?
I know his version has an error. but mine don't.
05-14-2012 02:13 PM
05-14-2012 02:23 PM - edited 05-14-2012 02:24 PM
Yes. You have to close the calling VI to release Excel. LabVIEW always does that. Not just Excel.
But did you still geting an error ?
05-14-2012 02:28 PM
@zou wrote:
Yes. You have to close the calling VI to release Excel. LabVIEW always does that. Not just Excel.
But did you still geting an error ?
Try running the code I just uploaded with the center section disabled. You can see that the excel.exe process will close after the VI executes, but before you close the calling vi.
05-14-2012 02:36 PM - edited 05-14-2012 02:37 PM
I just tried my version on my laptop. The Excel process DOES close before VI stop.
I'm using XP, Excel 2007, LV2009
My Excel version is: 12.0.6661.5000
05-14-2012 02:41 PM
@zou wrote:
Yes. You have to close the calling VI to release Excel. LabVIEW always does that. Not just Excel.
No, that is not true. If you run my VI test_v2.vi and it stops but LabIVEW is still running and the VI is still open, Excel does *not* show up in Task Manager.
05-14-2012 02:43 PM - edited 05-14-2012 02:43 PM
@zou wrote:
I just tried my version on my laptop. The Excel process DOES close before VI stop.
I'm using XP, Excel 2007, LV2009
My Excel version is: 12.0.6661.5000
Your VI works fine, but he wants to create a new Excel file, not open an existing file.
05-14-2012 02:45 PM
@LVSteve wrote:
Testing on my coworker's computer has revealed on Win7 you don't need to have *any* close references, and the excel.exe process will still stop running after the VI finishes, although you have to wait 10-15 seconds.
Very poor programming practice to not use Close references.
05-14-2012 02:46 PM
For new Excel file, there is not uncertainty, it's index 0. Should just use nyc's version.
And no need to ADD sheet, when add book, index0 is automatically added.
05-14-2012 02:48 PM
@LVSteve wrote:
Testing on my coworker's computer has revealed on Win7 you don't need to have *any* close references, and the excel.exe process will still stop running after the VI finishes, although you have to wait 10-15 seconds.
Here is the latest VI
Remove the Workbook.Save and move the Workbook.SaveAs to its place.