Disable button(shape) after click

  • Thread starter Thread starter Preschool Mike
  • Start date Start date
P

Preschool Mike

Does anyone know of any vba to disable a button (e.g., shape that runs a
macro) after it has been clicked. The button (shape) runs a macro that
counts and I want to prevent the user from accidently clicking twice.
 
Easiest way is to make a second copy of the button with no action
Put this behind the proper button and give the top button a trigger
animation of disappear (triggered by a click on itself) When you click the
macro will run first then the real button will disappear leaving the inactive
blank.

Don't try to use a macro to set visible to false because this will not reset
next time the presentation runs.
 
Does anyone know of any vba to disable a button (e.g., shape that runs a
macro) after it has been clicked.  The button (shape) runs a macro that
counts and I want to prevent the user from accidently clicking twice.

You can set the action for the button to ppActionNone:

With
Application.ActivePresentation.Slides(1).Shapes("SetupButton").ActionSettings(ppMouseClick)
.Action = ppActionNone
End With
 
Very clever, work nicely. Out of curiosity wouldn't creating a macro to set
visible to true at the beginning of the presentation reset it correctly? Or
not?
 
What would I use to reset it the next time?
--
Mike Mast
Special Education Preschool Teacher







- Show quoted text -

Each time the presentation is opened, it will reset the codeRun
variable to 'False' (default value for boolean variables). So,
whenever you open the presentation, it will allow the code to run only
1 time (unless you reset the variable yourself, e.g. "codeRun = False")
 
I think it will work to reset the button if you put the same code in
your Initialize procedure but change the .Action line to:

..Action = ppActionRunMacro

--David

What would I use to reset it the next time?


--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
Back
Top