ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CommandBarControl class (https://www.excelbanter.com/excel-programming/272114-commandbarcontrol-class.html)

John A Grandy

CommandBarControl class
 
apparently, this is not possible ...

Dim cbc As CommandBarControl
Set cbc = New CommandBarControl

??



Bob Phillips[_5_]

CommandBarControl class
 
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.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"John A Grandy" wrote in message
...
apparently, this is not possible ...

Dim cbc As CommandBarControl
Set cbc = New CommandBarControl

??





Chip Pearson

CommandBarControl class
 
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


"John A Grandy" wrote in message
...
apparently, this is not possible ...

Dim cbc As CommandBarControl
Set cbc = New CommandBarControl

??






All times are GMT +1. The time now is 02:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com