Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6962779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:42:15+00:00 2026-05-27T15:42:15+00:00

How can I tell the current user language in a vba program? I need

  • 0

How can I tell the current user language in a vba program?

I need this to show a form in an appropriate language.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:42:16+00:00Added an answer on May 27, 2026 at 3:42 pm

    My initial code (utilising this vbforum code) assumed that Windows and Excel share a common language – likely but not bulletproof.

    updated

    The revised code:

    1. Returns the Locale ID (LCID).
    2. Looks up the LCID from this msft link.
    3. Parses the LCID using a regexp to get the language.

    Sample output on my machine below

    The code will let the user know if there are any errors in accessing the LCID website, or in parsing the country name.

    enter image description here

        Sub GetXlLang()
            Dim lngCode As Long
            lngCode = Application.LanguageSettings.LanguageID(msoLanguageIDUI)
            MsgBox "Code is: " & lngCode & vbNewLine & GetTxt(lngCode)
        End Sub
    
        Function GetTxt(ByVal lngCode) As String
            Dim objXmlHTTP As Object
            Dim objRegex As Object
            Dim objRegMC As Object
            Dim strResponse As String
            Dim strSite As String
    
            Set objXmlHTTP = CreateObject("MSXML2.XMLHTTP")
            strSite = "http://msdn.microsoft.com/en-us/goglobal/bb964664"
    
            On Error GoTo ErrHandler
            With objXmlHTTP
                .Open "GET", strSite, False
                .Send
                If .Status = 200 Then strResponse = .ResponseText
            End With
            On Error GoTo 0
    
            strResponse = Replace(strResponse, "</td><td>", vbNullString)
            Set objRegex = CreateObject("vbscript.regexp")
            With objRegex
                .Pattern = "><td>([a-zA-Z- ]+)[A-Fa-f0-9]{4}" & lngCode                    
                If .Test(strResponse) Then
                    Set objRegMC = .Execute(strResponse)
                    GetTxt = objRegMC(0).submatches(0)
                Else
                    GetTxt = "Value not found from " & strSite
                End If
            End With
            Set objRegex = Nothing
            Set objXmlHTTP = Nothing
            Exit Function
    ErrHandler:
            If Not objXmlHTTP Is Nothing Then Set objXmlHTTP = Nothing
            GetTxt = strSite & " unable to be accessed"
        End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can anyone tell me how can I (programatically) add the current/selected user to a
As far as I can tell, this is isn't possible, so I'm really just
As far as I can tell, the best way to do this is do
I need to get current user name in my Wss 3.0 application. What is
As you can see below, I am checking to see if the current user
I have a need for generating JavaScript on the server. I can do this
Anyone can tell me which one is better (JAXB or Apache XMLBeans) taking in
Could anyone can tell me where I can find full ASP.NET MVC beta documentation?
As far as I can tell the iPhone multitouch framework sends the location of
so from what i can tell, you have to specify artifacts and working directory

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.