05-14-2012 09:49 AM
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.
05-14-2012 09:51 AM
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?
05-14-2012 10:00 AM
05-14-2012 10:09 AM
Thanks Ben. So the error happens in both excel 2003 and 2007, which leads me to believe it is the labview code.
05-14-2012 11:00 AM
> 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.
05-14-2012 11:37 AM
Anyone have that in LV2009 format?
Thank you.
05-14-2012 11:45 AM
Convert to LV2009.
05-14-2012 12:06 PM
@LVSteve 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.
05-14-2012 12:56 PM - edited 05-14-2012 12:56 PM
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.
05-14-2012 01:09 PM - edited 05-14-2012 01:14 PM
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.