+ Reply to Thread
Results 1 to 5 of 5

Run-time error 1004; "Unable to set the Hidden property of the Range Class"

  1. #1
    Registered User
    Join Date
    05-22-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    3

    Run-time error 1004; "Unable to set the Hidden property of the Range Class"

    I am new to excel programming so I apologize for any misuse of terms, terrible programming, and all around poor form!

    I am trying to protect a spreadsheet that I created that uses VBA to run some code. Everything works fine until I protected the sheet (minus the fields that I want users to fill in). Some details: the VBA is set up to detect when the word "hide" pops up in a specific field. "Hide" will turn on and off depending on the data the user enters to the unlocked fields and that entire row will then hide or unhide. My sheet has combo boxes (8 in total) that users use to enter data from a long list of options, and there are merged cells.

    What other information will be helpful in troubleshooting? Thanks so much for any input.

    Here is the code that I am using:
    Please Login or Register  to view this content.

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Run-time error 1004; "Unable to set the Hidden property of the Range Class"

    Untested, but try this.

    Please Login or Register  to view this content.
    Last edited by JapanDave; 05-22-2012 at 11:25 AM.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    05-22-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Run-time error 1004; "Unable to set the Hidden property of the Range Class"

    JapanDave - thanks for the reply, however I am getting the exact same issue. When I click on debug, "cel.EntireRow.Hidden = False" is highlighted. This was the case for my original code and yours as well.

    Any other ideas?

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Run-time error 1004; "Unable to set the Hidden property of the Range Class"

    I reckon you'll need to unprotect the sheet or protect the sheet using userinterfaceonly:=true when the workbook opens so that your code can then change it.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Registered User
    Join Date
    05-22-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Run-time error 1004; "Unable to set the Hidden property of the Range Class"

    JosephP - that worked great! I entered the following code in the "ThisWorkbook" workbook object. Still testing but haven't found any errors as of yet.

    (password modified of course

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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