Share via

Disable shape as button

Anonymous
2019-02-10T15:43:18+00:00

Hi,

I would like to disable a shape as button to run macro after first click.

Is this possible?

Thanks

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2019-02-10T18:43:15+00:00

    Hi Gord,

    For me that answer is like when I ask something like this:

    What the Americans do in Christmas? and you answer 

    " Go to America and you see"

    If I'm wrong, please tell me why.

    Thanks

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2019-02-11T01:17:32+00:00

    Welcome. . . .BTW variations of that that code can be found in the first three hits that are found in the sites my first response pointed you toward.

    Gord

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-02-10T22:13:08+00:00

    Hi Gord,

    Thanks a lot

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2019-02-10T20:45:25+00:00

    'Assuming you have used a CommandButton from the Activex Controls

    'Assign this macro to that button and the code will run once then be disabled

    'The code will be placed in the worksheet module

    Private Sub CommandButton1_Click()

    MsgBox "Macros will be now be disabled.  Re-open workbook to re-enable"

        Sheets(1).CommandButton1.Enabled = False

        CommandButton1.Caption = "Disabled"

    End Sub

    'Add the following Workbook_Open code to This workbook module

    'This will reenable the button upon opening the workbook

    Private Sub Workbook_Open()

             With Sheets(1)

                   .CommandButton1.Enabled = True

                   .CommandButton1.Caption = "Enabled"

            End With

    End Sub

    Gord

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2019-02-10T17:22:57+00:00

    Many examples of code found in these search results.

    https://www.google.com/search?client=firefox-b-d&q=excel+macro+run+once+only

    Gord

    Was this answer helpful?

    0 comments No comments