Welcome! Log In Create A New Profile

Advanced

[WD24] - Excel worksheet name

Posted by JP 
JP
[WD24] - Excel worksheet name
April 28, 2020 10:42AM
Hi All

I need to test the name of a worksheet tab in an Excel file. I use XLSOpen() to open the file and the help says I can use "LeafName" on an xlsDocument variable but I cant make it work.

If I use myXlsDocumentVariable..LeafName the syntax checker says the double dot is not recognized.

If I use myXlsDocumentVariable.LeafName the syntax checker is OK but it fails during runtime with "LeafName is not a valid column" error message.

How can I get the worksheet (leaf) name ?

Thanks

[UPDATE] - I found it - I need to use the property "WorksheetName" as per the Intellisense suggestion. The WD help file says "LeafName" but Intellisense says "WorksheetName". All good now. Thanks for reading smiling smiley



Edited 1 time(s). Last edit at 04/28/2020 10:48AM by JP.
Re: [WD24] - Excel worksheet name
April 28, 2020 11:40AM
Hi JP

I use this in Webdev

FOR i=1 TO xlsNbWorksheet(IDXLSFile)
xlsCurrentWorksheet(IDXLSFile, i)
ListAdd(combo_worksheet,IDXLSFile..WorksheetName)
END

Regards


Ericus Steyn
JP
Re: [WD24] - Excel worksheet name
April 29, 2020 06:17AM
Thanks Ericus. I got the "WorkSheetName" property working.

Cheers!
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: