Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Michigan, USA
    Posts
    408
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro Password Protect Doesn't Work (Excel 97 SR2)

    Hi Everyone,
    I am trying to use VBA code to password protect a worksheet. The code I am using protects the sheet but doesn't require a password to unprotect it. I thought I read somewhere that it is difficult (maybe impossible?) to password sheets using a macro. Can you tell me if the code I am using is correct or if indeed this isn't doable in a macro? BTW, there are many worksheets in the file and my macro would password each one of them after it completes the other tasks in the macro.

    ActiveSheet.Protect , Password:="test", DrawingObjects:=True, _
    Contents:=True, Scenarios:=True

    Help?
    TIA
    <font face="Comic Sans MS"><big><font color=4682b4>Sherry</font color=4682b4></big></font face=comic>

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro Password Protect Doesn't Work (Excel 97 SR2)

    Remove the comma after Protect.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Michigan, USA
    Posts
    408
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro Password Protect Doesn't Work (Excel 97 SR2)

    That's it!

    Thanks!!! <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>
    <font face="Comic Sans MS"><big><font color=4682b4>Sherry</font color=4682b4></big></font face=comic>

Posting Permissions

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