Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime Error '91' Object variable or With block variable not set Alec Coliver Excel Discussion (Misc queries) 2 October 24th 09 02:29 PM
Object Variable Not Set Error on Selection object Jean Excel Worksheet Functions 3 July 24th 06 06:45 PM
Run-Time error '91': Object variable of With block variable not set jammin1911 Excel Programming 3 June 6th 06 06:36 PM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM


All times are GMT +1. The time now is 06:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"