Custom Command Bar Options

G

Guest

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
 
J

JW

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top