I can't test this as I don't have access to any computers in other
countries, but the following should return the language that the computer
running the code is set up for. So, using it should allow you to use a test
structure similar to this in your own code...
If UserLanguage() = "English" Then
' The computer running this code has English as its native language
ElseIf UserLanguage() = "French" Then
' The computer running this code has English as its native language
Else
MsgBox "You didn't test for this language: " & UserLanguage()
End If
Put all of the following in a Module (Insert/Module from the
VB editor's
menu bar), then just call UserLanguage in your own code and it will return
the language set up in the regional settings for the computer running your
code...
Private Declare Function GetLocaleInfo Lib "kernel32" _
Alias "GetLocaleInfoA" _
(ByVal Locale As Long, _
ByVal LCType As Long, _
ByVal lpLCData As String, _
ByVal cchData As Long) As Long
Private Const LOCALE_SNATIVELANGNAME As Long = &H4
Public Function UserLanguage() As String
Dim sReturn As String, lReturn As Long, dwLocaleID As Long, Code As Long
Code = LOCALE_SNATIVELANGNAME
dwLocaleID = Application.LanguageSettings.LanguageID(msoLanguag eIDUI)
lReturn = GetLocaleInfo(dwLocaleID, Code, sReturn, Len(sReturn))
If lReturn Then
sReturn = Space$(lReturn)
lReturn = GetLocaleInfo(dwLocaleID, Code, sReturn, Len(sReturn))
If lReturn Then UserLanguage = Left$(sReturn, lReturn - 1)
End If
End Function
--
Rick (MVP - Excel)
"JR" wrote in message
...
Thank you both. Now I'll have to study Mr De Bruin's information and see
whether I can get my un-techie head round it. :-)
JR