CommandBarControl class

J

John A Grandy

apparently, this is not possible ...

Dim cbc As CommandBarControl
Set cbc = New CommandBarControl

??
 
B

Bob Phillips

John,

I think the problem is summed up in the help

You tried to instantiate an Automation object, but it was not a creatable
object.

A commandbarcontrol has to be added to a commandbar, it does not exist in
it's own right.
 
C

Chip Pearson

John,

No, that's not possible. You need to use the Add method of the
Controls collection to create the new object. Among other things,
the CommandBarControl object needs to have a Parent object, its
container, so you can't create a new CommandBarControl directly.
Use .Add.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com [email protected]
 
Top