LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need a way to return the sheet names for all sheets in excell

Hi,

This VI was ment for someone that was already working with LV and VBA.

If you want some explanation about the VBA part wel I never understood the strange ways of Microsoft and I think I never will  Smiley Wink 

For the LV part I think you have to follow a course or look at the Excel board for documented VI's

0 Kudos
Message 11 of 18
(844 Views)

Hello,

 

The posted example uses several property nodes.  Property Nodes are used to read/write properties of a reference.  You will find further information at the link below. 

 

LabVIEW 8.2 Help: Property Nodes

http://zone.ni.com/reference/en-XX/help/371361B-01/glang/property_node/

 

Please post back if you have specific questions about the example VI. 

 

Elizabeth S.

Applications Engineer

National Instruments

0 Kudos
Message 12 of 18
(833 Views)

Hi KC,

 

thank you for the VI Excel File WS names. But I am trying to figure out the reference Excel.Worksheet. How did you create that reference. I am only able to create reference for either sheets or workbook. So how do we create worksheet ref. Thank you. 

0 Kudos
Message 13 of 18
(492 Views)

@govindsankar wrote:

Hi KC,

 

thank you for the VI Excel File WS names. But I am trying to figure out the reference Excel.Worksheet. How did you create that reference. I am only able to create reference for either sheets or workbook. So how do we create worksheet ref. Thank you. 


Seems like you have posted in a very old thread, Its always better to start a new thread if you have a new query and what exatly is your issue ,Getting Sheet names/ Reference for work sheets?

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 14 of 18
(480 Views)

My objective is to get sheet names. But I downloaded the program from this page trying to understand how its done. I understood 90% of it. But there is one portion in the program which is a reference called Excel.Worksheet. I dont know where the reference is coming from. So since its part of a program written by someone in this thread, I think there is no use in starting a new thread. Because the one who wrote the program has to answer this I think. Thank you. 

0 Kudos
Message 15 of 18
(471 Views)

Browse for the Excel application Installed location and select specific objects.

 

PalanivelThiruvenkadam_0-1683722705257.png

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 16 of 18
(463 Views)

The Report Generation Toolkit can be a little confusing, but it is not too difficult to get a list of WorkSheet names for an existing Excel File.  Here is a Snippet in LabVIEW 2019 which can easily be "hand-coded" in any other version of LabVIEW (which will give you a chance to see what/how each of the Excel Functions work to provide these Sheet names).

Get Excel WorkSheet Names.pngStart with a Control (or a Path Constant) that "points to" an existing Excel WorkBook, with multiple WorkSheets (or even just a single WorkSheet).  The first function, above, is "Create Report", which, here, is a bit of a misnomer -- you are not "creating" a Report, but you are, in effect, reading an existing WorkBook.  [This is the "Template" input, the notion being you have a "template" and you use the "RGT" to "fill in the Blanks"].

 

"Create Report" will now open the Excel WorkBook you specified in "Excel Path".  The next function is "Excel WorkBook Properties", and one of its outputs is "WorkSheet Count", which we wire to a For Loop Count.  Inside the Loop, the Loop Index is wired to "Excel Get WorkSheet" (which "brings up" WorkSheet 0, then 1, then 2 ...), and we (again) use "Excel WorkBook Properties" to return the "Current WorkSheet Name".  For this exercise, I closed Excel with "Dispose Report" and output the array of WorkSheet names.

 

Bob Schor

0 Kudos
Message 17 of 18
(444 Views)

You can also use my 'Read XLSX File' VI to get the sheet names. No ActiveX required.

 

https://forums.ni.com/t5/LabVIEW/Darren-s-Occasional-Nugget-09-26-2022/m-p/4257604

Message 18 of 18
(426 Views)