Tengo un problema cuando creo una barra de menu tipo la de office con Archivo, Edicion, etc. Luego le agrego los items pero cuando quiero agregar item al sub menu creado ya no se como hacerlo, adjunto el codigo vba que he utilizado Set BarraDeveloptec = CommandBars.Add(Name:="DevelopTecBM", Position:=msoBarTop, MenuBar:=True) MenuBars("DevelopTecBM").Menus.Add Caption:="&Archivo" With MenuBars("DevelopTecBM").Menus("Archivo").MenuItems
.Add Caption:="Nuevo .AddMenu Caption:="Exportar a"
Te escribo el codigo de un Menu tipo 'Archivo' con Submenus, copialo en un modulo de excel y ejecutalo para que veas como funciona. Espero haberte sido de ayuda. Si tienes alguna duda ya sabes donde estoy. Option Explicit Sub CreateMenu() Dim cbMenu As CommandBarControl, cbSubMenu As CommandBarControl Set cbMenu = Application.CommandBars(1).Controls.Add(msoControlPopup, , , , True) With cbMenu .Caption = "&Mi menu" .Tag = "MyTag" .BeginGroup = False End With If cbMenu Is Nothing Then Exit Sub With cbMenu.Controls.Add(msoControlButton, 1, , , True) .Caption = "&Menu Item1" .OnAction = ThisWorkbook.Name & "!Macroname" End With With cbMenu.Controls.Add(msoControlButton, 1, , , True) .Caption = "&Menu Item2" .OnAction = ThisWorkbook.Name & "!Macroname" End With Set cbSubMenu = cbMenu.Controls.Add(msoControlPopup, 1, , , True) With cbSubMenu .Caption = "&Submenu1" .Tag = "SubMenu1" .BeginGroup = True End With With cbSubMenu.Controls.Add(msoControlButton, 1, , , True) .Caption = "&Submenu Item1" .OnAction = ThisWorkbook.Name & "!Macroname" .Style = msoButtonIconAndCaption .FaceId = 71 .State = msoButtonDown End With With cbSubMenu.Controls.Add(msoControlButton, 1, , , True) .Caption = "&Submenu Item2" .OnAction = ThisWorkbook.Name & "!Macroname" .Style = msoButtonIconAndCaption .FaceId = 72 .Enabled = False End With Set cbSubMenu = cbSubMenu.Controls.Add(msoControlPopup, 1, , , True) With cbSubMenu .Caption = "&Submenu2" .Tag = "SubMenu2" .BeginGroup = True End With With cbSubMenu.Controls.Add(msoControlButton, 1, , , True) .Caption = "&Submenu Item1" .OnAction = ThisWorkbook.Name & "!Macroname" .Style = msoButtonIconAndCaption .FaceId = 71 .State = msoButtonDown End With With cbSubMenu.Controls.Add(msoControlButton, 1, , , True) .Caption = "&Submenu Item2" .OnAction = ThisWorkbook.Name & "!Macroname" .Style = msoButtonIconAndCaption .FaceId = 72 .Enabled = False End With Set cbSubMenu = Nothing Set cbMenu = Nothing End Sub