View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JW[_2_] JW[_2_] is offline
external usenet poster
 
Posts: 638
Default Custom Command Bar Options

You can use the ActionControl property of the CommandBars collection
to figure out which button was pushed. For example, to make a button
cycle through a pressed/unpressed state, you could use:
If CommandBars.ActionControl.State = msoButtonDown Then
CommandBars.ActionControl.State = msoButtonUp
Else
CommandBars.ActionControl.State = msoButtonDown
End If

You can also pass the caption as well. You can then use the caption
as the paramater in an If statement or Select Case statement to run
the appropriate code.

If I misunderstood your question and gave you completely irrelevant
information, I appologize.

Hope this helps.


Cory wrote:
Using XL2003, I have a custom command bar in workbook. The command bar
contains a menu that when expanded presents the user with a variety of
options to select ("All Levels","Next Level", "Bottom Level"). My problem is
figuring out how to make the options behave similar to the "Formula Bar" and
"Status Bar" options under the View menu. Only one option should be able to
be selected at a time and I will need to a way to check which option is
selected to provide to another procedure as a parameter. Thanks in advance
for your help.

-Cory