Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
object variable not set with commandbars
I have the following code in my workbook_open procedu
CommandBars("worksheet menu bar").Controls().Add(Type:=msoControlPopup, befo=CommandBars("worksheet menu bar").Controls.Count + 1, temporary:=True).Caption = "Client Reports" So I am basically trying to add a menu item to "worksheet menu bar". It worked fine when I tested it in a module after the workbook had opened, but when I added it to the workbook_open procedure and reopened the workbook I get this error. I also get it on commandbars(0).name, so are the commandbars not loaded yet? Is there a way to load them? Thank you. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
object variable not set with commandbars
Use: Application.CommandBars -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "icccapital" wrote in message I have the following code in my workbook_open procedu CommandBars("worksheet menu bar").Controls().Add(Type:=msoControlPopup, befo=CommandBars("worksheet menu bar").Controls.Count + 1, temporary:=True).Caption = "Client Reports" So I am basically trying to add a menu item to "worksheet menu bar". It worked fine when I tested it in a module after the workbook had opened, but when I added it to the workbook_open procedure and reopened the workbook I get this error. I also get it on commandbars(0).name, so are the commandbars not loaded yet? Is there a way to load them? Thank you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Runtime Error '91' Object variable or With block variable not set | Excel Discussion (Misc queries) | |||
Object Variable Not Set Error on Selection object | Excel Worksheet Functions | |||
Run-Time error '91': Object variable of With block variable not set | Excel Programming | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming |