+ Reply to Thread
Results 1 to 5 of 5

Run-Time Error '1004':

  1. #1
    Registered User
    Join Date
    06-20-2019
    Location
    Minnesota
    MS-Off Ver
    Office 2019
    Posts
    39

    Run-Time Error '1004':

    All of the sudden my workbook is returning this error whenever I open the workbook:

    Run-time error '1004':
    Unable to set the Hidden property of the range class


    I have attached my code, as well a bolded line that the debugger is highlighting. This is in my "ThisWorkbook" Project, rather than the specific sheet. The odd thing is that the code still hides the rows on open, but the error code still persists.
    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,368

    Re: Run-Time Error '1004':

    I'm guessing that the Active Sheet is NOT Sheets("360Review") when the workbook is opened. It's possible that you, or someone else, saved the workbook with a different worksheet selected/active.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,368

    Re: Run-Time Error '1004':

    Try it this way

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-20-2019
    Location
    Minnesota
    MS-Off Ver
    Office 2019
    Posts
    39

    Re: Run-Time Error '1004':

    I'm still getting the same error, with the following line being the one that seems to be causing the issue:

    .Range("4:104").EntireRow.Hidden = True

    Edit: After doing some research, many people who had this issue discovered that it was from having comments in the rows they wanted to hide. I checked and I do not have a single comment on the file, so it shouldn't be that. I have also tried copying/pasting everything into a new workbook and that did not work either.
    Last edited by xAcrosonicx; 08-19-2019 at 11:12 AM.

  5. #5
    Registered User
    Join Date
    06-20-2019
    Location
    Minnesota
    MS-Off Ver
    Office 2019
    Posts
    39

    Re: Run-Time Error '1004':

    After stepping into the VBA, it took me to my code on the 360 Review sheet. A quick overview is that I have a "password" cell (B1) where a user enters their given password and the VBA for this page will hide/unhide rows depending on the password they enter. I attempted to make it so the user could simply hit enter after they type their password and it will run the macro (called Reveal) and that is where the Error was occurring with the hiding. I ended up moving my Reveal sub and the one I created for hitting the enter key into a module, which solved the issue.
    Last edited by xAcrosonicx; 08-19-2019 at 11:47 AM.

+ 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] I am getting error as "Run Time error '1004' Microsoft excel cannot paste the data
    By Amittapre in forum Excel Programming / VBA / Macros
    Replies: 43
    Last Post: 03-24-2017, 04:40 PM
  2. [SOLVED] Sort Macro Run-time error '1004': Application/Object-defined error.
    By sam1212 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2014, 10:05 AM
  3. Addon error : Run-time error '1004': Method 'MacroOptions' of object '_Application' failed
    By jtcoleman in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 02-05-2014, 12:23 PM
  4. Replies: 4
    Last Post: 11-15-2013, 05:03 PM
  5. VBA Code...error = run time error 1004 autofilter method of range class failed
    By Dariusd7 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2013, 04:49 PM
  6. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  7. [SOLVED] run-time error '1004': Application-defined or object-deifined error
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-10-2005, 05:05 PM

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