TRAPPING PRESSED BUTTON

  • Thread starter Thread starter jason
  • Start date Start date
J

jason

How do I set up some code so that I can trap the Id/Name of the
toolbar button that the user has just pressed.

Also how do I set up some code so that when the user presses a custom
button the Face of the button changes?

any help greatly appreciated

Jason
 
Commandbars.ActionControl returns the button that was pressed.

If you store the faces as pictures on a worksheet, then you can copy the new
face and paste it to the control using PasteFace.

Robert Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
 
If you just want to indicate that the button has been pressed, just
change the .State property:


With Application.Commandbars.ActionControl
.State = Not .State
End With

will toggle between pressed and not pressed.
 

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

Back
Top