Excel language

M

Marco

I am opening an Excel workbook with the code:
If ExcelRuns() Then
Set oapp = GetObject(, "Excel.Application")
Else
Set oapp = CreateObject("Excel.Application")
End If
This all works fine. I can open an Excel file and change
stuff in it.
However somewhere in the code I want to select a sheet:

oapp.sheets("sheet" & i).SELECT

Unfortunately in Dutch a "sheet" is called a "blad" so
when a Dutch version of Excel runs this code generates an
error.
Is there a way to find out which version of Excel is
running so I can use code like:

If oapp.???.language = "US" Then
oapp.sheets("sheet" & i).SELECT
Else 'Dutch in this case
oapp.sheets("blad" & i).SELECT
End If
I could not find a property of the object which shows the
language of the Excel running but perhaps there is a way
to obtain this information.

Many thanks
Marco
 
V

Van T. Dinh

I would suggest asking in an Excel newsgroup rather than here.

This newsgroup is for Microsoft Access and you probably find more expert
advice from the Excel newsgroups.
 
M

Marco

I am opening the excel application from MS Access, that
is why I dropped the question in this forum.

Marco
 
V

Van T. Dinh

I knew that you are automating Excel (the automation client is not
important, I guess) but the coding part that needs fixing is Excel, not
Access. Hence, I thought that you would probably get more informed
responses from Excel newsgroups.

If anyone answers your question here, it is because he/she knows Excel VBA
and not Access VBA.
 
Top