+ Reply to Thread
Results 1 to 14 of 14

errrors while trying to delete a commandbutton

  1. #1
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500

    errrors while trying to delete a commandbutton

    hi

    I have a commandbutton placed on a sheet call "Information" the Commandbuttons Name is Updater.

    i have the following piece of code

    Private Sub updater_Click()
    Range("a1").Activate
    Sheets("information").Updater.Delete
    End Sub

    however it does not seem to work? The purpose of the commandbutton is to run a once off macro.

  2. #2
    Ardus Petus
    Guest

    Re: errrors while trying to delete a commandbutton

    Sheets'"information").oleobjects("updater").delete

    HTH
    --
    AP

    "funkymonkUK" <[email protected]> a
    écrit dans le message de news:
    [email protected]...
    >
    > hi
    >
    > I have a commandbutton placed on a sheet call "Information" the
    > Commandbuttons Name is Updater.
    >
    > i have the following piece of code
    >
    > Private Sub updater_Click()
    > Range("a1").Activate
    > Sheets("information").Updater.Delete
    > End Sub
    >
    > however it does not seem to work? The purpose of the commandbutton is
    > to run a once off macro.
    >
    >
    > --
    > funkymonkUK
    > ------------------------------------------------------------------------
    > funkymonkUK's Profile:
    > http://www.excelforum.com/member.php...o&userid=18135
    > View this thread: http://www.excelforum.com/showthread...hreadid=555947
    >




  3. #3
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    sorry i am having troubles with the code.

    I have the following

    Private Sub updater_Click()
    Range("a1").Activate
    Sheets("Information").OLEObjects("updater").Delete
    End Sub

    and am getting a Runtime 1004 : Application-Defined or object-defined error.

    i have no idea why this could be happening.

  4. #4
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    sorry i am having troubles with the code.

    I have the following

    Private Sub updater_Click()
    Range("a1").Activate
    Sheets("Information").OLEObjects("updater").Delete
    End Sub

    and am getting a Runtime 1004 : Application-Defined or object-defined error.

    i have no idea why this could be happening.

  5. #5
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    sorry i am having troubles with the code.

    I have the following

    Private Sub updater_Click()
    Range("a1").Activate
    Sheets("Information").OLEObjects("updater").Delete
    End Sub

    and am getting a Runtime 1004 : Application-Defined or object-defined error.

    i have no idea why this could be happening.

  6. #6
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    sorry i am having troubles with the code.

    I have the following

    Private Sub updater_Click()
    Range("a1").Activate
    Sheets("Information").OLEObjects("updater").Delete
    End Sub

    and am getting a Runtime 1004 : Application-Defined or object-defined error.

    i have no idea why this could be happening.

  7. #7
    Mark Driscol
    Guest

    Re: errrors while trying to delete a commandbutton

    Your code worked for me in Excel 2002.

    Mark


    funkymonkUK wrote:
    > sorry i am having troubles with the code.
    >
    > I have the following
    >
    > Private Sub updater_Click()
    > Range("a1").Activate
    > Sheets("Information").OLEObjects("updater").Delete
    > End Sub
    >
    > and am getting a Runtime 1004 : Application-Defined or object-defined
    > error.
    >
    > i have no idea why this could be happening.
    >
    >
    > --
    > funkymonkUK
    > ------------------------------------------------------------------------
    > funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
    > View this thread: http://www.excelforum.com/showthread...hreadid=555947



  8. #8
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    i have excel 2000 if that helps

  9. #9
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    i have excel 2000 if that helps

  10. #10
    Chip Pearson
    Guest

    Re: errrors while trying to delete a commandbutton

    You code works for me in Excel 2003. Ensure that the sheet is not
    protected.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com

    "funkymonkUK"
    <[email protected]> wrote
    in message
    news:[email protected]...
    >
    > sorry i am having troubles with the code.
    >
    > I have the following
    >
    > Private Sub updater_Click()
    > Range("a1").Activate
    > Sheets("Information").OLEObjects("updater").Delete
    > End Sub
    >
    > and am getting a Runtime 1004 : Application-Defined or
    > object-defined
    > error.
    >
    > i have no idea why this could be happening.
    >
    >
    > --
    > funkymonkUK
    > ------------------------------------------------------------------------
    > funkymonkUK's Profile:
    > http://www.excelforum.com/member.php...o&userid=18135
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=555947
    >




  11. #11
    Ardus Petus
    Guest

    Re: errrors while trying to delete a commandbutton

    Please send your faulty workbook as attachment to [email protected]

    HTH
    --
    AP

    "funkymonkUK" <[email protected]> a
    écrit dans le message de news:
    [email protected]...
    >
    > sorry i am having troubles with the code.
    >
    > I have the following
    >
    > Private Sub updater_Click()
    > Range("a1").Activate
    > Sheets("Information").OLEObjects("updater").Delete
    > End Sub
    >
    > and am getting a Runtime 1004 : Application-Defined or object-defined
    > error.
    >
    > i have no idea why this could be happening.
    >
    >
    > --
    > funkymonkUK
    > ------------------------------------------------------------------------
    > funkymonkUK's Profile:
    > http://www.excelforum.com/member.php...o&userid=18135
    > View this thread: http://www.excelforum.com/showthread...hreadid=555947
    >




  12. #12
    Chip Pearson
    Guest

    Re: errrors while trying to delete a commandbutton

    You code works for me in Excel 2003. Ensure that the sheet is not
    protected.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com

    "funkymonkUK"
    <[email protected]> wrote
    in message
    news:[email protected]...
    >
    > sorry i am having troubles with the code.
    >
    > I have the following
    >
    > Private Sub updater_Click()
    > Range("a1").Activate
    > Sheets("Information").OLEObjects("updater").Delete
    > End Sub
    >
    > and am getting a Runtime 1004 : Application-Defined or
    > object-defined
    > error.
    >
    > i have no idea why this could be happening.
    >
    >
    > --
    > funkymonkUK
    > ------------------------------------------------------------------------
    > funkymonkUK's Profile:
    > http://www.excelforum.com/member.php...o&userid=18135
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=555947
    >




  13. #13
    Ardus Petus
    Guest

    Re: errrors while trying to delete a commandbutton

    Please send your faulty workbook as attachment to [email protected]

    HTH
    --
    AP

    "funkymonkUK" <[email protected]> a
    écrit dans le message de news:
    [email protected]...
    >
    > sorry i am having troubles with the code.
    >
    > I have the following
    >
    > Private Sub updater_Click()
    > Range("a1").Activate
    > Sheets("Information").OLEObjects("updater").Delete
    > End Sub
    >
    > and am getting a Runtime 1004 : Application-Defined or object-defined
    > error.
    >
    > i have no idea why this could be happening.
    >
    >
    > --
    > funkymonkUK
    > ------------------------------------------------------------------------
    > funkymonkUK's Profile:
    > http://www.excelforum.com/member.php...o&userid=18135
    > View this thread: http://www.excelforum.com/showthread...hreadid=555947
    >




  14. #14
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    yeah sorry it was password Protected works like a treat.

+ 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