View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default VBA problem with CommandBars

if the CommandBarControl is empty.........

would be

if cbPop.controls.count = 0 then


--
Regards,
Tom Ogilvy



"zuEgg" wrote:


Die_Another_Day ha scritto:

What do you mean by "empty"?
You can check to see if it has been assigned to anthing.
Var1 = cbpop.OnAction
you can assign the control to the variable control and check if that is
empty...
Set cbpop = Application.CommandBars("Worksheet Menu
Bar").Controls("xxx")
if cbpop is nothing then
....
end if

Does that get you anywhere?

Die_Another_Day


the CommandBarControl can contain other CommandBarControls as sub
menus. With empty i mean check if the CommandBarControl has no items
contained in it