Worksheets("Sheet1") for foreign languages

B

bg_ie

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.
 
N

NickHK

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top