Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application.International(xlCountrySetting)

Status
Not open for further replies.

SAS343

IS-IT--Management
Oct 1, 2007
3
DK
Hello!

I have "inherited" some Visual Basic code as shown below.
This code only accept the pprogram to run in English (United States) Language setting. However I need the program to run in arbitrary (all) language settings and
specifically in Swedish, Norweigian and Danish language
settings. Does anyone know how I can do this?

Obviously if a = 1 the program works fine but if it has
another number it stops and tells the user to change to
English/United States language setting.

Maybe a shall be set to different numbers regarding of which
language setting I run on my computer?

Any help and advise is much appreciated.

Thanks Hans


********* VB code ***************
a = Application.International(xlCountrySetting)

If a <> 1 Then
Message = "Before running this macro, change your Regional settings (Control Panel) to English (United States)"
a = MsgBox(Message, 0)
End
End If

Range("C14:K56").Select
Selection.ClearContents
Range("E32").Select
 
********* VB code ***************

should read

********* VBA code ***************

;-)
Try forum707

But be warned that simply eliminating the check may lead to problems. It looks to me like the original programmer wasn't prepared to deal with non-US date and number formats. If you take the check out your Excel app may start doing some strange things. In other words, as I'm sure you are aware, there's a lot more that you will need to change ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top