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 (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top