ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheets("Sheet1") for foreign languages (https://www.excelbanter.com/excel-programming/379398-worksheets-sheet1-foreign-languages.html)

[email protected]

Worksheets("Sheet1") for foreign languages
 
Hi,

The line: Set xlSheet = xlBook.Worksheets("Sheet1") fials in my
application since my version of excel is in swedish and uses Blad1,
Blad2, Blad3 etc.

I'm not sure what language my customers use.

What alternative can I use to Worksheets("Sheet1")?

Thanks,

Barry.


NickHK

Worksheets("Sheet1") for foreign languages
 
Yes, it will fail because "Sheet1" refers to the text that appears in the WS
tab and as such any wrong text would fails (but Worksheets("Blad1") would
succeed).
If you do not know the name, you can use the index:
Set xlSheet = xlBook.Worksheets(1)

Or maybe look into using the .CodeName.

NickHK

wrote in message
ups.com...
Hi,

The line: Set xlSheet = xlBook.Worksheets("Sheet1") fials in my
application since my version of excel is in swedish and uses Blad1,
Blad2, Blad3 etc.

I'm not sure what language my customers use.

What alternative can I use to Worksheets("Sheet1")?

Thanks,

Barry.





All times are GMT +1. The time now is 04:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com