Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VB Macro Menu in two different languages

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default VB Macro Menu in two different languages

Use the ID of the Help menu

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




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VB Macro Menu in two different languages

This was perfect!

Thank you so much!

The Tech Net community, as always, came through!



"Ron de Bruin" wrote:

Use the ID of the Help menu

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




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"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



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
Multiple Languages Infexus Bytez Excel Discussion (Misc queries) 1 March 30th 10 05:18 PM
VB Macro Menu in two different languages Bernie Deitrick Excel Programming 0 February 4th 09 03:24 PM
different languages Matt Excel Discussion (Misc queries) 0 June 19th 07 03:36 PM
Languages getting muddled Roger PB Excel Discussion (Misc queries) 0 March 12th 05 02:53 PM
Changing Languages Jamesy Excel Discussion (Misc queries) 3 December 10th 04 03:06 PM


All times are GMT +1. The time now is 01:11 PM.

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

About Us

"It's about Microsoft Excel"