VB Macro Menu in two different languages

  • Thread starter Thread starter David Langschied
  • Start date Start date
D

David Langschied

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, _
Before:=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
 
Use the ID of the Help menu

Sub test()
MsgBox Application.CommandBars("Worksheet Menu Bar").FindControl(ID:=30010).Index
End Sub
 
This was perfect!

Thank you so much!

The Tech Net community, as always, came through!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top