+ Reply to Thread
Results 1 to 19 of 19

macro stopped working. runtime error

  1. #1
    Registered User
    Join Date
    11-16-2015
    Location
    bradford
    MS-Off Ver
    2013
    Posts
    18

    macro stopped working. runtime error

    I have an excel database with hidden worksheets to make notes on. I have been using this code to pull up the hidden sheet and then hide it again when I click off of it.


    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

    This code has now stopped working and gives the error runtime error '424' object required.

    As far as I know I haven't changed anything so I cant understand why it has suddenly stopped working.
    Last edited by alansidman; 12-11-2015 at 12:07 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    re: macro stopped working. runtime error

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    re: macro stopped working. runtime error

    When you run and get the error message, click on debug and tell us which line is highlighted.

  4. #4
    Registered User
    Join Date
    11-16-2015
    Location
    bradford
    MS-Off Ver
    2013
    Posts
    18

    Re: macro stopped working. runtime error

    With Evaluate(Target.SubAddress).Parent

    this is the highlighted line

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: macro stopped working. runtime error

    Tried your code and cannot replicate the error message. Here is a link to explain the error message, however.

    https://msdn.microsoft.com/en-us/lib.../gg251554.aspx

  6. #6
    Registered User
    Join Date
    11-16-2015
    Location
    bradford
    MS-Off Ver
    2013
    Posts
    18

    Re: macro stopped working. runtime error

    Thanks, but I still don't understand how to correct this error, or why it has suddenly stopped working when it was fine before and nothing has changed.

    I have tried removing all the code saving & closing the doc then re-entering it again but I still get the error code.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: macro stopped working. runtime error

    What's the value of Target.SubAddress when you get the error?
    If posting code please use code tags, see here.

  8. #8
    Registered User
    Join Date
    11-16-2015
    Location
    bradford
    MS-Off Ver
    2013
    Posts
    18

    Re: macro stopped working. runtime error

    Im not sure what exactly you mean. This is what I see
    Doc1-page-001.png

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: macro stopped working. runtime error

    What does this display when you add it before the line that causes the error?
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    11-16-2015
    Location
    bradford
    MS-Off Ver
    2013
    Posts
    18

    Re: macro stopped working. runtime error

    When I add that and try to follow the link I get this message,

    '3'!r1c1

    And the MsgBox Target.SubAddres is highlighted in the debugger

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: macro stopped working. runtime error

    What happens if you use Range instead of Evaluate?
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    11-16-2015
    Location
    bradford
    MS-Off Ver
    2013
    Posts
    18

    Re: macro stopped working. runtime error

    i Get an error message saying

    run-time error 1004:
    Method 'range' of object '-worksheet' failed

  13. #13
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: macro stopped working. runtime error

    Do you have a sheet with the name '3'?

  14. #14
    Registered User
    Join Date
    11-16-2015
    Location
    bradford
    MS-Off Ver
    2013
    Posts
    18

    Re: macro stopped working. runtime error

    Yes, I have 950 hidden sheets, each sheets name is the a number, so 950 sheets named 1,2,3,4 etc...

  15. #15
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: macro stopped working. runtime error

    The only way I can replicate the error you describe is if I don't have a worksheet named exactly '3' in the active workbook.

    What happens when you enter this in the immediate window (CTRL+G)?
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    11-16-2015
    Location
    bradford
    MS-Off Ver
    2013
    Posts
    18

    Re: macro stopped working. runtime error

    I just get a message saying the reference is not valid.

    The only things that show up in that window are the one sheet that is constantly visible and table 1 (the table within the visible sheet)

  17. #17
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: macro stopped working. runtime error

    What's the actual error message?

  18. #18
    Registered User
    Join Date
    11-16-2015
    Location
    bradford
    MS-Off Ver
    2013
    Posts
    18

    Re: macro stopped working. runtime error

    'the reference is not vailid'

  19. #19
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: macro stopped working. runtime error

    That's the error message when you enter this in the immediate window?
    Please Login or Register  to view this content.
    Are you sure you have a worksheet with the exact tab name '3'? No leading/trailing spaces?

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

+ 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. [SOLVED] Compile Macro has stopped working
    By Runnin L8 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2014, 10:47 AM
  2. Microsoft Excel Stopped Working Error
    By Fredbugatti in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2014, 12:56 PM
  3. [SOLVED] Macro stopped working - please help
    By kellynicolebarrett in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-01-2014, 05:49 AM
  4. Macro stopped working
    By EverettRich in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-21-2013, 03:17 PM
  5. Macro Stopped Working
    By andybason in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2012, 01:20 PM
  6. Macro stopped working.
    By joleen in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-06-2011, 05:37 AM
  7. Excel 2007 : Macro stopped working
    By jaw0001 in forum Excel General
    Replies: 5
    Last Post: 10-13-2010, 07:59 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