Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Anyone know how to dynamically add a separator menu item to a custom menu in
Excel 2003? This code works with the exception that instead of creating a separator menu item, it simply creates another menu item with caption "-". Is it possible to get there from here? TIA Des __________________________________________________ _______ Sub test() Dim ComBar As CommandBar Dim PopMain As CommandBarPopup Dim PopAbout As CommandBarButton Dim PopDivider As CommandBarButton For Each ComBar In CommandBars If ComBar.Name = "Worksheet Menu Bar" Then Set PopMain = ComBar.Controls.Add(msoControlPopup, , , (ComBar.Controls.Count - 1), True) PopMain.Caption = "Custom Menu Name Here" Exit For End If Next If PopAbout Is Nothing Then Set PopAbout = PopMain.Controls.Add(msoControlButton, , , , True) PopAbout.Caption = "&About..." End If If PopDivider Is Nothing Then Set PopDivider = PopMain.Controls.Add(msoControlButton, , , , True) PopDivider.Caption = "-" End If yadda, yadda, yadda... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding a menu item to Excel | Excel Discussion (Misc queries) | |||
How do we add a separator in Excel 2007 menu using VBA | Excel Discussion (Misc queries) | |||
Adding a Menu Item into a sheet as a button | Excel Programming | |||
Adding a menu item right click menu when clicking on a single. | Excel Programming | |||
add separator bar to right-click menu | Excel Programming |