PDA

View Full Version : Object variable or with block variable not set



rshinn
10-03-2010, 08:27 AM
Hello,

I get the following compile error when I try to run the following code:

Set cb = CommandBars.Add(Name:="Bookkeeper Helper", Position:=msoBarFloating)

Runtime error 91 Object variable or with block variable not set

Thank you for the help.

Richard

Bob Phillips
10-03-2010, 10:17 AM
What have you declared cb as?

rshinn
10-04-2010, 07:44 AM
Hi Nihil,

I've declared cb as follows:

Dim cb As CommandBar

Thank you.

Richard

Bob Phillips
10-04-2010, 07:54 AM
No thoughts, it works fine for me.