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: 

Activex Excel Automation: the Missing Handle

My apologies.  Your VI is also not doing anything that I need to do. You are selecting a worksheet by index.  Is that correct?

 

Your approach is akin to the heisenberg uncertainty principle; if I don't know what the current activesheet is, I can use your code to redefine it and get its reference.  I need a property node, not an invoke node.

 

Again, I appreciate the assistance of the community.  It is not my goal to cause trouble in a thread where I am asking for help.

0 Kudos
Message 21 of 62
(1,101 Views)

Ben, yes the xlsx filetype does not exist in excel 2003, so by removing the (51) the code should work for you.  Do you see the excel.exe process open after the code is finished executing?

0 Kudos
Message 22 of 62
(1,100 Views)

OK, I see what you mean. Yes the Excel.exe process still run after the code finished execution. It stop when I close the calling vi.

 

Ben64

Message 23 of 62
(1,087 Views)

Thanks Ben.  So the error happens in both excel 2003 and 2007, which leads me to believe it is the labview code.

0 Kudos
Message 24 of 62
(1,080 Views)

> Your approach is akin to the heisenberg uncertainty principle; if I don't know what the current activesheet is, I can use your code to redefine it and get its reference. 

> I need a property node, not an invoke node.

 

You are right if you open a file.  otherwise the activesheet is index 0.

 

Modified your test2.vi to open a file, and close the refnum at the end.  => Excel close when all refnum closed.

 

George Zou
0 Kudos
Message 25 of 62
(1,057 Views)

Anyone have that in LV2009 format?

 

Thank you.

0 Kudos
Message 26 of 62
(1,047 Views)

Convert to LV2009.

George Zou
0 Kudos
Message 27 of 62
(1,040 Views)

@Arc.g wrote:

My apologies.  Your VI is also not doing anything that I need to do. You are selecting a worksheet by index.  Is that correct?

 

Your approach is akin to the heisenberg uncertainty principle; if I don't know what the current activesheet is, I can use your code to redefine it and get its reference.  I need a property node, not an invoke node.

 

Again, I appreciate the assistance of the community.  It is not my goal to cause trouble in a thread where I am asking for help.


If you think that my VI is useless to you, so be it.

It is flexible enough to let you choose ANY worksheet in an Excel workbook file and be able to read from it or write to it.

 

All your VI does is work on the "ActiveSheet" which is always Sheet1. You do realize that there can be multiple worksheets in a workbook, right???

 

Againt read the Microsoft Object Reference Model documentation.

 

 

 

0 Kudos
Message 28 of 62
(1,030 Views)

nyc, I think we are talking past each other.

 

You seem to be missing the point that the VI's I am posting are simplified and part of a large, established, working code base.  I am trying to only illustrate the functionality that is not working.

 

I am asking about why functionality X does not work, and you are replying with how functionality Y is all you need.  Do you understand?

 

In case you missed it, I can't get the Workbook.Activesheet refnum to close properly.

0 Kudos
Message 29 of 62
(1,017 Views)

I understand what you are having problem with.

 

You didn't simply your large, established working code base correctly, because I don't understand how it even worked in the first place.

 

I will say again, pay attention to what references are being closed and when. The same problem that I saw in the JPG in your first post is still there in the VI you posted last.

 

 

 

0 Kudos
Message 30 of 62
(1,012 Views)