LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can't access Excel._Worksheet reference from NI_Excel.lvcass object

Solved!
Go to solution

I am trying to access the "Excel._Worksheet" reference but when I use the "unbundle by name" I get a broken wire.  The green object is the NI_report.lvclass and the blue object is the NI_Excel.lvclass.

2010-05-20_112106.png

Not sure why I'm being prevented from getting the reference this way since I see this working as shown in NI_Excel.lvclass:Excel Rename Worksheet.

 

2010-05-20_112828.png

 

(I'm trying get the Worksheet reference so I can call the _Worksheet.Delete method.  I don't believe the Report Generation toolkit includes a Worksheet Delete VI.)

 

(I'm using LabVIEW 8.6)

 

-Joel

0 Kudos
Message 1 of 9
(4,381 Views)
Solution
Accepted by topic author Snood1

That's the incapsulation feature provided by LabVIEW classes, it protects the private content of the class. You can only unbundle in VIs that are parts of the class.

 

There is a VI that returns the application and document ref:

Excel Get ActiveX references

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 9
(4,370 Views)

TCPlomp wrote:

That's the incapsulation feature provided by LabVIEW classes, it protects the private content of the class. You can only unbundle in VIs that are parts of the class.

 

There is a VI that returns the application and document ref:

Excel Get ActiveX references

 

Ton


 

Adding to Ton's reply...

 

THe VI Ton showed you was omitted from the first release of the modified toolkit. We screamed so they added that VI to let us be creative. If you can't find that VI in your install, you will have to upgrade the toolkit.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 9
(4,366 Views)

To be a little more specific, you need to be running LabVIEW 8.6.1 with Report Generation Toolkit 1.1.4 to get this VI.  Or, of course, LabVIEW 2009 with Report Generation Toolkit 2009.

Message Edited by Darren on 05-20-2010 03:00 PM
Message 4 of 9
(4,362 Views)

Any technical reason why the toolkit 1.1.4 won't run on 8.6?

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 5 of 9
(4,355 Views)

My mistake.  According to the Report Generation Toolkit 1.1.4 readme, you can use it with LabVIEW 8.6.

0 Kudos
Message 6 of 9
(4,345 Views)
Thanks, everyone.  I am familiar with data encapsulation, but forgot that it would apply to labview classes too.  Smiley Surprised  I upgraded to RGT 1.1.4 so that I could use the "Excel Get ActiveX References" VI.  And yes, it works in LV 8.6!
0 Kudos
Message 7 of 9
(4,333 Views)

Hi TCPLomp,

 

Thanks for the information!!

 

But does anyone have any idea how to get the class reference from the ActiveX reference. This is exactly opposite to what NI is offering.

 

I don't know how the NI engineers missed out this point when they can offer one way, so they could also offer it the other way too and that's what even I'm looking for. I've worked upon something like adding/inserting a new sheet in the workbook (NI library has it) but at the place that I choose (not at the end like NI Library does). Why can't these engineers think in advance or atleast gives us the option to modify the library for our use instead of just restricting like that. I just want to understand that. I feel MATLAB is flexible in this sense.

 

Thanks for your help!!

Manjeeth

0 Kudos
Message 8 of 9
(3,629 Views)

Manjeeth, 

 

In terms of getting the class reference from the ActiveX reference, try using a property node. 

 

Also, I have attached a screen shot of a program that will allow you to specify where to add a worksheet.

 

Katie

 

 

Katie Collette
National Instruments
0 Kudos
Message 9 of 9
(3,610 Views)