Unprotect Worksheet Macro With Password

  • Here is my macro, how do I add the password to make it work properly?

    Code
    Sub unprotect()
    ' unprotect Macro
    ' Macro recorded 12/30/2004 by '
    
    
        ActiveSheet.unprotect 
        ActiveWorkbook.unprotect 
        End Sub


    Both the sheet and the workbook are protected and use the same password


    EDIT: jiuk - code tags added

  • Re: Unprotect macro with password not working


    You just need to place the password in the next parameter

    Code
    ActiveSheet.unprotect "password"
    ActiveWorkbook.unprotect "password"
    
    
    Or 
    
    
    ActiveSheet.unprotect Password:="password"
    ActiveWorkbook.unprotect Password:="password"
  • Re: Unprotect macro with password not working



    ok here is my protect and unprotect macros.


    My protect macro seems to work just fine, my unprotect macro gives me an error message that the password supplied is not correct. However, when I type in the password it works just fine.


    Any ideas?



    ok now the passwords are not working at all today, where as they were yesterday (at least I thought they were). I am generally very good and careful with my passwords.


    I guess I need to start over if I can't figure out the passwords

  • Hey I tried your MACRO and it works fine for me!!


    Hey Bolo Grubb!!

    Thank you very much for the macro it works fine with me.

    I was running both macros just like the way you posted them in one module but I realized that it would not work that way... I don't know that much about macros!

    So I decided to run the Protect Macro in one Module





    And then I ran the unprotect Macro in another Module


    _____________________________________________________________



    IT WORKED FANTASTIC!!!!.. Thank you to all of you on this post for the help. I needed the info badly.

    FOR THOSE PEOPLE TRYING TO USE THIS MACRO MAKE SURE YOU TYPE IN THE DATE (-when the file was created-) OF THE FILE YOU ARE TRYING ON (12/30/2004) AND THE PERSON WHO CREATED THE FILE (by fp773a)

    ALSO MAKE SURE YOU TYPE IN THE WORD YOU WANT TO USE AS THE PASSWORD!! In this case the word "dilbert" is used. So good luck!!





    I like this forum that I decided to join it... good Info here!!:smile:

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!