View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Steve Davis Steve Davis is offline
external usenet poster
 
Posts: 12
Default Menus in xlmenubar


hi when this sheet opens up the first thing it has to do is wipe out file to
help to limit the amout of damage users of the sheet can do to it all this
works fine
i then remake a complete new set of menus all this works fine but when i put
a submenu in my menu i cant add to it
like in excel click view then toolbars
but cant add to the toolbars menu
"Bob Phillips" wrote:

Use commandbatrs

Dim idx As Long

On Error Resume Next
Application.CommandBars(1).Controls("&Name1").Dele te
On Error GoTo 0

idx = Application.CommandBars.FindControl(ID:=30010).Ind ex
With Application.CommandBars(1).Controls.Add(Type:=msoC ontrolPopup,
befo=idx)

.Caption = "&Name1"

With .Controls.Add(Type:=msoControlButton)

.Caption = "menu1"
.OnAction = "Test"
End With
End With


--

HTH

Bob

"Steve davis" <Steve wrote in message
...
Sub Macro1()
MenuBars(xlWorksheet).Menus.Add Caption:="&Name1", befo="&Help"
With MenuBars(xlWorksheet).Menus("&Extras").MenuItems
.Add Caption:="Name1", OnAction:="Macro2"
.AddMenu Caption:="menu1"
End With
End Sub


how do i add a new caption to menu1 and also the onaction
could anyone please help



.