+ Reply to Thread
Results 1 to 4 of 4

Problem with script to password protect and hide a sheet

  1. #1
    Registered User
    Join Date
    06-09-2010
    Location
    Mass
    MS-Off Ver
    Excel 2007
    Posts
    12

    Problem with script to password protect and hide a sheet

    Hello!

    Real brief summary; I have a workbook I need to distribute but I do not want the users to be able to see the contents of two of the sheets in it ever.

    I am trying to use a code to hide a sheet and require a password to open it.

    Currently I have

    Please Login or Register  to view this content.
    This works fine despite showing the sheet when it asks for the password (I got around this by making all the cells white text/white background.

    The one problem I am seeing is when a user opens the file, if they do not enable the macros, they can unhide the sheets all they like and see the data.
    Last edited by macross; 11-02-2012 at 12:40 PM.

  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,436

    Re: Problem with script to password protect and hide a sheet

    You have to force users to enable macros. You do that by using a Splash screen that is visible with instructions on it and setting EVERY other sheet to Very Hidden (in the VBE or using code). Then, when they enable macros, you display the password dialogue. If they get it right, you hide the Splash screen and unhide other relevant sheets. Look for examples of forcing users to enable macros ... tedious to set up but can do what you want. That said, Excel is inherently insecure and it's no big deal to get at hidden sheets.

    Regards, TMS
    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
    Registered User
    Join Date
    06-09-2010
    Location
    Mass
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Problem with script to password protect and hide a sheet

    Simple enough, works well, thank you.

  4. #4
    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,436

    Re: Problem with script to password protect and hide a sheet

    You're welcome.

+ 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