+ Reply to Thread
Results 1 to 2 of 2

Deleting Command Button

  1. #1
    James W.
    Guest

    Deleting Command Button

    When using the following code I receive an
    error...ActiveSheet.Shapes("CommandButton1").Delete

    I am assuming it is becuase I have placed this code within the event
    CommandButton1_Click(). I would like to get this to work becuase after I
    execute my other code I am self desctructing the code and the button.

    Help is greatly appreciated!

  2. #2
    Jim Rech
    Guest

    Re: Deleting Command Button

    Try this:

    Private Sub CommandButton1_Click()
    Application.OnTime Now, "KillCmdbtn"
    End Sub

    and in a regular module:

    Sub KillCmdBtn()
    ActiveSheet.Shapes("CommandButton1").Delete
    End Sub

    --
    Jim Rech
    Excel MVP
    "James W." <[email protected]> wrote in message
    news:[email protected]...
    | When using the following code I receive an
    | error...ActiveSheet.Shapes("CommandButton1").Delete
    |
    | I am assuming it is becuase I have placed this code within the event
    | CommandButton1_Click(). I would like to get this to work becuase after I
    | execute my other code I am self desctructing the code and the button.
    |
    | Help is greatly appreciated!



+ 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