LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Activex Excel Automation: the Missing Handle

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.

 

George Zou
0 Kudos
Message 41 of 62
(939 Views)

Georges, Excel is closing but if you look in the task manager the excel.exe process is still running.

 

Ben64

0 Kudos
Message 42 of 62
(937 Views)

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 ?

 

George Zou
0 Kudos
Message 43 of 62
(932 Views)

@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.

0 Kudos
Message 44 of 62
(929 Views)

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

 

George Zou
0 Kudos
Message 45 of 62
(921 Views)

@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.

0 Kudos
Message 46 of 62
(917 Views)

@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.

 

 

0 Kudos
Message 47 of 62
(913 Views)

@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.

 

 

0 Kudos
Message 48 of 62
(905 Views)

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.

 

George Zou
0 Kudos
Message 49 of 62
(904 Views)

@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.
0 Kudos
Message 50 of 62
(900 Views)