Is it possible to programmatically determine where a user is?

E

Edward

Hi everybody,
I’m writing some VBA code to customize several office programs I know how to
find users login name but I’m not sure that is possible to find the region or
country they are ? If I can find their country then I can apply some default
settings for each region. We have offices in US, Europe and Asia.
Thanks,
 
B

Bob Phillips

Try

application.International(xlcountrysetting)

it will be a code which needs interpreting, for example 44 is GB.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
R

Ron de Bruin

Hi Bob

Yes 1 = US

US Vista with US O 2007

MsgBox Application.International(xlCountryCode) = 1
MsgBox Application.International(xlCountrySetting) = 1

US Win XP with German O2007

MsgBox Application.International(xlCountryCode) = 49
MsgBox Application.International(xlCountrySetting) = 1


So as far as I can test it

xlCountryCode = Excel language version
xlCountrySetting = Windows language version


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


Bob Phillips said:
I get 1 on my system for that Ron, which I assume is the US, so I reckoned
it was the language version?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
R

Ron de Bruin

From Help

xlCountryCode Long Country/Region version of Microsoft Excel.
xlCountrySetting Long Current country/region setting in the Windows Control Panel.


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


Ron de Bruin said:
Hi Bob

Yes 1 = US

US Vista with US O 2007

MsgBox Application.International(xlCountryCode) = 1
MsgBox Application.International(xlCountrySetting) = 1

US Win XP with German O2007

MsgBox Application.International(xlCountryCode) = 49
MsgBox Application.International(xlCountrySetting) = 1


So as far as I can test it

xlCountryCode = Excel language version
xlCountrySetting = Windows language version
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top