LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"excel get worksheet.vi"

A program I am workin on uses the "Excel Get Worksheet.vi" from the Report Generation Toolkit 1.1.0. The VI works just fine on the computer I am programming on (which is odd itslef because this computer does not even have Excel or Office on it ??), but when I take it to the worksite, the VI comes up with a broken Run Button. One of the Properity Nodes is showing up with black text for the properity and the wire running out is broken. The specific properity is "Shapes" from the Node "_Worksheet". The computer that this error shows up on has Office 2003 I believe. All the other properity nodes seem to work just fine. Any suggestions as to what's going on here? I will post a picture, but as I'm not at the work site, the properity node is not blacked out. 
 
 
Thanks
0 Kudos
Message 1 of 7
(4,991 Views)

Usually, that would indicate a wrong Active-X class for Excel installed on the target PC. 

Curiously... however on the one you initially used..  Did it have Excel at one point?  Or maybe you selected a class which is available on the initial PC to develop code, but is not available on the second one.  Both being the wrong class...

If your right click on the active-x class reference, choose Select Active-X Class, and browse; do you find the same original class that you had selected initially?  However, if you select the correct class, you should then be able to debug the rest of the Property Node.

RayR



Message Edited by JoeLabView on 05-23-2008 05:19 PM
0 Kudos
Message 2 of 7
(4,989 Views)

That's just the thing. This is a VI that came either wither Labview 7.1 or with the Report Generation toolkit. I didn't make, modify or edit this VI at all. I just called it as a SubVI, passing nothing but the error cluster and a refnum (generated by another vi that came with the Report Generation toolkit. I tried to find the properity manually, but could not find it in the listing. I think that once the Toolkit is installed it will add the ActiveX controls it needs to run even if the computer does not have Office or Excel. At least that's the only reason I can think of why it would run on a computer without either. I tried to see where the VI was getting the reference, but the VI that it's generated in is locked and I can't get to the block diagram.

Im thinking that one of the following things is happening.

1. The computer at work has some corrupted Excel data that is blocking the Shapes ActiveX control from loading.

2. Some of the Report Generation toolkit files are corrupted, however, we tried un-installing and re-installing twice now, so that's about ruled out.

or 3. that the work's version of Office has since been updated and the _Worksheet -> Shapes control is now called something else.

If anyone has any insight to this please let me know.

Thanks again.

 

0 Kudos
Message 3 of 7
(4,981 Views)
Hi,

I would have to agree with a previous post. I realize that your VI came from the Report Generation Toolkit and the it was "pre-configured". Can you try digging into the VI at the computer that works and find which ActiveX control it is calling? After you have determined this, can you try to manually find it on the computer that is not working? It is also very possible that the version of Excel that you have no longer has the same COM API and that is why those properties are missing. I have Excel 2007 on my Machine, if you want post your code and I can try it here.
Eli S.
National Instruments
Applications Engineer
0 Kudos
Message 4 of 7
(4,931 Views)
I don't think uploading the VI will do much good because if you don't have the Report Generation toolkit, there will be a lot of errors as there are lots of calls to VI's specific to the toolkit. If you do have the tooklit, the VI is found at (Labview Dir)\vi.lib\addons\_office\excel.llb\Excel Get Worksheet.vi

I also did a bit of searching and the docoumentation for the toolkit says that the ActiveX information is called dynamically so that any computer that does not have Excel or Word, the VI will show up alright. (Also, I don't run the VI that needs Excel at home because it does generate an error when it tries to open the non-existant Excel, but the block diagram itself has no errors.)

So as of right now, I have no idea why this VI would work here, but only ONE property node for the ActiveX controls would not work somewhere else, when there are about a dozen other ones that work just fine. Next time I am out at the job site I will try to manually find the _Worksheet > Shapes properity and go from there.

Thanks fot the input.
0 Kudos
Message 5 of 7
(4,921 Views)
There is a persistant problem with the Excel properties "Value" and "Value2".  Depending on which version of Excel you are using, one of the two is required and the other will cause a broken arrow.  Perhaps it is the same for "Shapes".  Click on the bad "Shapes" and see if there is something that is similar.  I came across this on the web: "Use the same syntax as for the Shapes collection but replace Shapes by ChartObjects or OLEObjects as appropriate."
0 Kudos
Message 6 of 7
(4,909 Views)

Hi.

Sometimes Microsoft change the functionality of an ActiveX call witout changing the name of the function.

Iv'e seen this with the Workbooks.Open from version 9.0 til ver. 11.0 .

Workaround is to click the bad property/method and select it from the list again. (As stated in the previous post)

Did the trick for me at least.

Good luck

Don't forget to rate a good Answer....
---------------------------------------------------------
Here should be some cool signature

But there's NOT

LabVIEW 2012-2017
---------------------------------------------------------
0 Kudos
Message 7 of 7
(4,893 Views)