Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    May 2002
    Location
    Aiken, SC
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Password Protect WB (Excel 97)

    I developed a workbook with password protected pages. A maintenance macro allows the owner to edit the WS. VBA code requires the owner to enter the password to unprotect the WS. However, when the editing is completed and it's time to re-protect the WS, the protect code turns on protection without a password. Is there a way with VBA code to protect the WS with a preselected password?

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Password Protect WB (Excel 97)

    This works for me:

    <pre> Worksheets("Sheet1").Protect Password:="MyPassword"
    </pre>

    Legare Coleman

  3. #3
    New Lounger
    Join Date
    May 2002
    Location
    Aiken, SC
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Password Protect WB (Excel 97)

    Thanks. That did work. I failed to use quotes around the password (duh!).

Posting Permissions

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