>I'm creating a menu from VBA program. But I can't find any info in Excel
>Help how to insert a menu separator. Any idea?
Check out the BeginGroup property. Setttig it to True adds the divider line.
Kaz Babiarz <babi...@microlab.com> wrote in message
news:01bf0eed$3fafff40$846da7d1@default...
Example of adding a new menu-item to Excel's built in
Worksheet menubar:
Dim CBar As CommandBar
Dim MyMenu As Object
Set CBar = CommandBars("Worksheet Menu Bar")
'->Add new menu item to the worksheet menubar
With CBar.Controls
Set MyMenu = .Add(Type:=msoControlPopup, temporary:=True)
MyMenu.Caption = "&My Bar"
End With
'-> Add new submenu-item- note: New group
With CBar.Controls("&My Bar").Controls
Set MyMenu = .Add(Type:=msoControlButton, temporary:=True)
MyMenu.Caption = "My &Item"
MyMenu.BeginGroup = True
End With
Play around with the above example ...
HTH
Perry de Lima
Dim mnbNew As Menu
Set mnbNew = MenuBars(xlWorksheet).Menus.Add("&Options")
mnbNew.MenuItems.Add "Run &Utility", "Show_Form"
mnbNew.MenuItems.Add "-"
the last line will add a 'separator' line - just add more menu items
after this
On Mon, 04 Oct 1999 23:46:47 -0500, Myrna Larson
<myrna...@home.net> wrote:
>On 5 Oct 1999 03:31:32 GMT, "Kaz Babiarz" <babi...@microlab.com> wrote:
>
>>I'm creating a menu from VBA program. But I can't find any info in Excel
>>Help how to insert a menu separator. Any idea?
>