Enabled Property of Shapes?

  • Thread starter Thread starter Joe HM
  • Start date Start date
J

Joe HM

Hello -

I have a worksheet with a button on it that I called "undoButton". How
can I now set the Enabled property of this button from a macro?

I did the following and it "almost" works ...

ActiveSheet.Shapes("undoButton").Select
Selection.Enabled = False

The only problem is that it selects the button which will be confusing
for the user. I then tried

ActiveSheet.Shapes("undoButton").Enabled = false

but that wouldn't work.

How can I access the properties of the button and change them? The
ActiveSheet.Shapes("undoButton").Locked = true worked ... why not the
Selected?

Thanks!
Joe
 
try

Activesheet.Buttons("Undobutton").Enabled = False

assumes a button from the forms toolbar.
 
Try this:
ActiveSheet.Shapes("undoButton").ControlFormat.Enabled = false
Excel recognizes the control (i.e. button) when you choose the "Selection",
but the Shape itself is just a "container" for the control and has no Enabled
property of its own.
 

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