Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete specific menu item from custom menu
I am creating a new menu called STI to be used by future add-ins. Within
that menu, I added a menu item(msControlButton), Format Aging Report, to run a macro. How do I delete Format Aging Report without deleting STI menu? Sub AddMenus() Dim cbMainMenuBar As CommandBar Dim HelpMenuIndex As Integer Dim cbcSTIMenu As CommandBarControl 'Would like to try to delete "Format Aging Report" here instead of current code On Error Resume Next Application.CommandBars("Worksheet Menu Bar").Controls("&STI").Delete On Error GoTo 0 Set cbMainMenuBar = Application.CommandBars("Worksheet Menu Bar") HelpMenuIndex = cbMainMenuBar.Controls("Help").Index Set cbcSTIMenu = cbMainMenuBar.Controls.Add(Type:=msoControlPopup, Befo=HelpMenuIndex) cbcSTIMenu.Caption = "&STI" With cbcSTIMenu.Controls.Add(Type:=msoControlButton) .Caption = "Format Aging Report" .OnAction = "AgingReportFormat" End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Context-sensitive custom menu item. | Excel Programming | |||
Adding Sub Menu Item to Current Custom Menu | Excel Programming | |||
Excel 2000 Custom Menu Item | Excel Discussion (Misc queries) | |||
Setting OnAction of custom menu item? | Excel Programming | |||
Custom Menu Item specific to a workbook | Excel Programming |