Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Obtaining OS language
Hello everyone,
I have tried to obtain the OS language of my computer using VBA, but no success. Could anyone please help me with this problem? I know it can be done by using WinAPI, though I dont know how Thanking you all in advance Max |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Obtaining OS language
try
Sub os() MsgBox Application.OperatingSystem End Sub -- Don Guillett SalesAid Software "Max Potters" wrote in message ... Hello everyone, I have tried to obtain the OS language of my computer using VBA, but no success. Could anyone please help me with this problem? I know it can be done by using WinAPI, though I dont know how Thanking you all in advance Max |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Obtaining OS language
I would like to know the OS language, not the operating system I am running
"Don Guillett" wrote in message ... try Sub os() MsgBox Application.OperatingSystem End Sub -- Don Guillett SalesAid Software "Max Potters" wrote in message ... Hello everyone, I have tried to obtain the OS language of my computer using VBA, but no success. Could anyone please help me with this problem? I know it can be done by using WinAPI, though I dont know how Thanking you all in advance Max |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Obtaining OS language
Private Declare Function GetThreadLocale Lib "kernel32" () As Long
Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long 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 Const LOCALE_SENGLANGUAGE As Long = &H1001 'English name of lang Dim LCID As Long '--------------------------------------------------------------------------- Public Function GetUserLocaleInfo(ByVal dwLocaleID As Long, ByVal dwLCType As Long) _ As String '--------------------------------------------------------------------------- Dim sReturn As String Dim r As Long r = GetLocaleInfo(dwLocaleID, dwLCType, sReturn, Len(sReturn)) 'if successful.. If r Then sReturn = Space$(r) r = GetLocaleInfo(dwLocaleID, dwLCType, sReturn, Len(sReturn)) If r Then GetUserLocaleInfo = Left$(sReturn, r - 1) End If End If End Function '--------------------------------------------------------------------------- Public Function LanguageName() As String '--------------------------------------------------------------------------- LCID = GetSystemDefaultLCID() LanguageName = GetUserLocaleInfo(LCID, LOCALE_SENGLANGUAGE) End Function -- HTH RP (remove nothere from the email address if mailing direct) "Max Potters" wrote in message ... I would like to know the OS language, not the operating system I am running "Don Guillett" wrote in message ... try Sub os() MsgBox Application.OperatingSystem End Sub -- Don Guillett SalesAid Software "Max Potters" wrote in message ... Hello everyone, I have tried to obtain the OS language of my computer using VBA, but no success. Could anyone please help me with this problem? I know it can be done by using WinAPI, though I dont know how Thanking you all in advance Max |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to change German language data into Eglish Language in a colum | Excel Discussion (Misc queries) | |||
language support in excel sheet using a third party language tool | Excel Worksheet Functions | |||
OS language and Office language conflicts | Excel Worksheet Functions | |||
How can I programatically change the language in the language bar? | Excel Discussion (Misc queries) | |||
How to change the excel format from language to language? | Excel Discussion (Misc queries) |