Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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
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
language support in excel sheet using a third party language tool seema Excel Worksheet Functions 0 March 13th 06 06:06 AM
OS language and Office language conflicts teejay Excel Worksheet Functions 1 February 10th 06 05:31 PM
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:26 AM.

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

About Us

"It's about Microsoft Excel"