View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default 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.