+ Reply to Thread
Results 1 to 6 of 6

Command buttons no longer working

  1. #1
    Registered User
    Join Date
    11-29-2018
    Location
    Sunny Cairns, QLD AUST
    MS-Off Ver
    2010
    Posts
    97

    Command buttons no longer working

    Hi all,

    I recently got my big workbook working perfectly. I realised that I didn't need a couple of the command buttons I was using so I deleted them. Now none of them work. Originally I had 28 buttons each of which called an almost identical macro. I can not see why this would occur. Below is the code for 2 of the buttons. Commandbutton1 and 14 were deleted. it comes up with this error.

    "Run-time error '1004':

    Unable to get the OLEObjects property of the Worksheet class
    "

    The bold line is what is highlighted for the error.

    Please Login or Register  to view this content.
    Last edited by Dragondude; 02-26-2019 at 07:07 PM.

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Command buttons no longer working

    If you don't have 28 buttons, you shouldn't be looping from 1 to 28 anymore.
    Rory

  3. #3
    Registered User
    Join Date
    11-29-2018
    Location
    Sunny Cairns, QLD AUST
    MS-Off Ver
    2010
    Posts
    97

    Re: Command buttons no longer working

    I have tried changing it to 26 but it doesn't seem to make a difference. Do I need to change all 26 buttons for just one of them to work?

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Command buttons no longer working

    If you deleted 1 and 14 you need to skip processing those. Either loop through all the OLEObjects and, if necessary, test for a CommandButton (assuming all buttons should be processed), or add an if clause like:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-29-2018
    Location
    Sunny Cairns, QLD AUST
    MS-Off Ver
    2010
    Posts
    97

    Re: Command buttons no longer working

    Thank you. I will try that.

    Is there a way to change the CommandButton number so I renumber them 1 to 26?

  6. #6
    Registered User
    Join Date
    11-29-2018
    Location
    Sunny Cairns, QLD AUST
    MS-Off Ver
    2010
    Posts
    97

    Re: Command buttons no longer working

    Solved. I answered my own question. I changed the commandbutton numbers and reordered the macros and it all seems to work. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Command Buttons not working in Page Layout view
    By Epscan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-08-2017, 03:00 PM
  2. HELP!! Command Buttons not working - Variable not defined
    By milo1984 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2016, 01:23 PM
  3. [SOLVED] Buttons No Longer Working
    By SHUTTEHFACE in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-15-2014, 05:26 PM
  4. command buttons stopped working
    By icyman in forum Excel General
    Replies: 1
    Last Post: 12-11-2014, 04:55 PM
  5. Command buttons not working
    By superchew in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2014, 06:59 PM
  6. User added buttons no longer working
    By capt_tony in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2013, 11:42 AM
  7. Userform fade not working from command buttons
    By berty2000 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-01-2011, 08:30 AM

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