Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default How to know the windows language

Hi,
I'm wondering if there's a way to know what is the windows language
installed inside the computer where the macro is runned. I tried to find a
parameter inside GetLocaleInfo function but all seems to be related to
control panel settings. Any idea?
Thanks!
Alex
--
Alex St-Pierre
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default How to know the windows language

I would like to know if the OS is french or english, is there a way to know
that?
Thanks!
--
Alex St-Pierre


"Don Guillett" wrote:

Sub os()
MsgBox Application.OperatingSystem

End Sub


--
Don Guillett
SalesAid Software

"Alex St-Pierre" wrote in message
...
Hi,
I'm wondering if there's a way to know what is the windows language
installed inside the computer where the macro is runned. I tried to find a
parameter inside GetLocaleInfo function but all seems to be related to
control panel settings. Any idea?
Thanks!
Alex
--
Alex St-Pierre




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 284
Default How to know the windows language

Alex,

If you're running on systems with only a single OS installed and the OS is
WinXP, WinME, Win2k or beyond, then WMI is present and the following will
work. The OS language will be returned as a code value; 1033 for American
English, 1036 for French.

Sub OSlanguage()
Dim objWMI As Object
Dim colItems As Object
Dim objItem As Object
Dim languageCode As Integer

Set objWMI = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\.\root\cim v2")
Set colItems = objWMI.ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objItem In colItems
languageCode = objItem.OSlanguage
Next objItem

MsgBox languageCode

End Sub


Steve Yandl



"Alex St-Pierre" wrote in message
...
I would like to know if the OS is french or english, is there a way to know
that?
Thanks!
--
Alex St-Pierre


"Don Guillett" wrote:

Sub os()
MsgBox Application.OperatingSystem

End Sub


--
Don Guillett
SalesAid Software

"Alex St-Pierre" wrote in
message
...
Hi,
I'm wondering if there's a way to know what is the windows language
installed inside the computer where the macro is runned. I tried to
find a
parameter inside GetLocaleInfo function but all seems to be related to
control panel settings. Any idea?
Thanks!
Alex
--
Alex St-Pierre






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default How to know the windows language

Not sure if it will help you but have a look at LanguageSettings in help,
also the intellisence

Dim LS As LanguageSettings
Set LS = Application.LanguageSettings

nInstall = LS.LanguageID(msoLanguageIDInstall)
nDUI = LS.LanguageID(msoLanguageIDUI)
bool = LS.LanguagePreferredForEditing(msoLanguageIDFrench Canadian)

also perhaps -

nCS = application.International(xlCountrySetting)
and various other relevant default formatting info that can be changed in
say the Normal style of a workbook if necessary.

Regards,
Peter T


"Alex St-Pierre" wrote in message
...
Hi,
I'm wondering if there's a way to know what is the windows language
installed inside the computer where the macro is runned. I tried to find a
parameter inside GetLocaleInfo function but all seems to be related to
control panel settings. Any idea?
Thanks!
Alex
--
Alex St-Pierre





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change German language data into Eglish Language in a colum Execel work sheet language problems Excel Discussion (Misc queries) 1 October 29th 07 09:59 PM
Windows version language and Excel version language Jac Tremblay[_4_] Excel Programming 3 July 1st 06 04:04 PM
language support in excel sheet using a third party language tool seema Excel Worksheet Functions 0 March 13th 06 06:06 AM
How can I programatically change the language in the language bar? Roy Barr Excel Discussion (Misc queries) 0 March 14th 05 09:47 PM
How to change the excel format from language to language? zee Excel Discussion (Misc queries) 2 January 30th 05 06:51 PM


All times are GMT +1. The time now is 05:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"