CommandBars

  • Thread starter Thread starter defj
  • Start date Start date
D

defj

Is there an easy way to add one existing Menu as a subMenu
to another? I tried the logical .control.Add way and got
nowhere.
 
You could add all of the controls individually, but I am not aware how you
could add the whole menu.

To add the help menu as an example

Application.CommandBars("Worksheet Menu
Bar").Controls("MyMenu").Controls.Add ID:=30010, Temporary:=True

or

Dim myControl As CommandBarControl
Dim myID As Long

Set myControl = Application.CommandBars("Worksheet Menu
Bar").Controls("myMenu")
myID = Application.CommandBars("cell").Controls("Format cells...").ID
myControl.Controls.Add ID:=myID, temporary:=True

Check here for a list of IDs
http://support.microsoft.com/default.aspx?scid=kb;en-us;159466
XL97: List of ID Numbers for Built-In Command Bar Controls


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
As an example, this adds the tools menu as a sub-menu under the Data menu:

Application.CommandBars("Data").Controls.Add _
Type:=msoControlPopup, _
Id:=30007, Before:=6
 
Back
Top