Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2004
    Posts
    361
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Password Protection (Excel 2002)

    I have some code that will protect all sheets in a workbook that requires password. The password is in the code. Obviously if a user knows how to view code on a sheet he could find the password.
    In order to prevent access to the code, one could hide the sheet but this is not very safe as again one could realize that there may be a hidden sheet and then get access to the code.
    My question then, is there a method of setting a password when one hides a sheet?
    Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Password Protection (Excel 2002)

    !) You can set a sheet to be "very hidden" in VBA. Such a sheet will not be listed in Format | Sheet | Unhide... The only way to unhide a very hidden sheet is through VBA. To make a sheet very hidden:

    Sheets("MySheet").Visible = xlSheetVeryHidden

    2) You can protect the VBA code in a workbook for viewing:
    - In the Visual Basic Editor, select Tools | VBAProject Properties...
    - Activate the Protection tab.
    - Tick the "Lock project for viewing" check box.
    - Enter the same password in both text boxes.
    - Save and close the workbook.
    When you reopen it, you cannot view the code behind the workbook without supplying the password first.

  3. #3
    3 Star Lounger
    Join Date
    Aug 2004
    Posts
    361
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Password Protection (Excel 2002)

    Thanks, Hans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •