ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB Macro Menu in two different languages (https://www.excelbanter.com/excel-programming/423397-re-vbulletin-macro-menu-two-different-languages.html)

Bernie Deitrick

VB Macro Menu in two different languages
 
David,

Application.LanguageSettings.LanguageID(msoLanguag eIDHelp)

will return a long - for me, US English - it returns 1033.

You could use code like:

Dim myLan As Long
myLan = Application.LanguageSettings.LanguageID(msoLanguag eIDHelp)
.....
cbcCutomMenu.Caption = IIF(myLan = 1033,"&Level Load",IIF(myLan = Othervalue,"&Other words for
Level Load","&Default Value"))


HTH,
Bernie
MS Excel MVP


"David Langschied" wrote in message
...
I have a VB macro inside of an Excel spreadsheet. To run the macro, I have
created a Menu selection that is situated right before "Help". In my code a
look for the index value of the help menu and place my menu before it ...

iHelpMenu = _
cbMainMenuBar.Controls("?").Index
.
.
.
Set cbcCutomMenu = _
cbMainMenuBar.Controls.Add(Type:=msoControlPopup, _
Befo=iHelpMenu)
cbcCutomMenu.Caption = "&Level Load"

I now need to do this for Latin-Spanish users. The help menu in this
language is "?", so my macro does not work. I could just figure out the
number that "Help" is and not bother specifying it, but that would mess
someone else up if they have custom menus.


So, my question is: How can I figure out the Language of the user first and
apply my menu selection as an if...else statement?

David





All times are GMT +1. The time now is 05:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com