TRAPPING PRESSED BUTTON

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
 
B

Bob Flanagan

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
 
J

JE McGimpsey

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.
 
Top