Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 zuEgg wrote: Hi. I'm having problems writing a macro that creates a custom CommandBarControl. I have to check if the CommandBarControl is empty and then delete it. Here is the code of what i'm doing: Dim cbpop As CommandBarControl Dim cbctl As CommandBarControl Dim bExists As Boolean bExists = False For Each cbpop In Application.CommandBars("Worksheet Menu Bar").Controls If cbpop.Caption = "xxx" Then ' if the CommandBarControl is empty......... Application.CommandBars("Worksheet Menu Bar").Controls("xxx").Delete End If Next I've been searching for long but i've not found any hint for solving the problem. Thanks, Massimo |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
commandbars in add-in | Excel Programming | |||
Commandbars dynamic menu creation problem | Excel Programming | |||
CommandBars vs CommandBars(1).Controls | Excel Programming | |||
help --- Commandbars | Excel Programming |