Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
menu bar and error 91
hi, i wrote some code which is essentially the following and it gives
error 91 on due to the following line CommandBars("worksheet menu bar").FindControl(ID:=30002).Copy bar:=CommandBars("mymenu") any ideas on how to fix it? thanks again. this is the full code: 'note be sure not to save since the remove bar macro is not in this code Sub Create_MyMenu() 'Hide the Excel worksheet menu bar Application.CommandBars(1).Enabled = False 'Remove MyMenu if it exists On Error Resume Next MenuBars("MyMenu").Delete On Error GoTo 0 'Create a new blank menu bar called MyMenu MenuBars.Add "MyMenu" 'Add menu items "Azri1", to the MyMenu bar MenuBars("MyMenu").Menus.Add Caption:="Azri1" CommandBars("worksheet menu bar").FindControl(ID:=30002).Copy bar:=CommandBars("mymenu") 'Add menu items(macros) under the "Azri1" menu item. With MenuBars("MyMenu").Menus("Azri1").MenuItems ..Add Caption:="&Macro1", OnAction:="Macro1" ..Add Caption:="&Macro2", OnAction:="Macro2" 'etc End With 'Display the "MyMenu" menu bar MenuBars("MyMenu").Activate End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to use "standard deviation" option in Y error bar menu? | Charts and Charting in Excel | |||
error indicator menu | Excel Discussion (Misc queries) | |||
Menu bar reset error | Excel Programming | |||
Error when creating menu item on command bar | Excel Programming | |||
Error Handling for "my" menu bar | Excel Discussion (Misc queries) |