[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

Worksheets("Sheet1") for foreign languages

Barry

12/14/2006 8:21:00 AM

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.

1 Answer

NickHK

12/14/2006 8:29:00 AM

0

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

<bg_ie@yahoo.com> wrote in message
news:1166084446.242172.301930@16g2000cwy.googlegroups.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.
>