+ Reply to Thread
Results 1 to 4 of 4

Enabled Property of Shapes?

  1. #1
    Joe HM
    Guest

    Enabled Property of Shapes?

    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


  2. #2
    Tom Ogilvy
    Guest

    Re: Enabled Property of Shapes?

    try

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

    assumes a button from the forms toolbar.

    --
    Regards,
    Tom Ogilvy


    "Joe HM" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >




  3. #3
    K Dales
    Guest

    RE: Enabled Property of Shapes?

    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.

    "Joe HM" wrote:

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


  4. #4
    Joe HM
    Guest

    Re: Enabled Property of Shapes?

    Great ... Thanks so much!

    Joe


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1