LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default VBA problem with CommandBars

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
commandbars in add-in Geoff Excel Programming 0 June 19th 06 09:28 PM
Commandbars dynamic menu creation problem GusEvans Excel Programming 6 April 6th 06 07:21 PM
CommandBars vs CommandBars(1).Controls Sean Excel Programming 3 April 3rd 06 01:34 PM
help --- Commandbars wAyne Excel Programming 5 February 17th 06 08:17 PM


All times are GMT +1. The time now is 11:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"