Forum Discussion

esatyilmaz's avatar
esatyilmaz
Copper Contributor
Jul 14, 2022
Solved

Excel 365 VBA vs Review>Protect Sheet password

Hello,   I am encountering a strange issue. I lock a worksheet by Review>Protect Sheet and set a worksheet password such as 0010 and then in the VBA code I want to unprotect with the same password ...
  • NikolinoDE's avatar
    Jul 14, 2022

    esatyilmaz 

    At the beginning of the procedure you can use
    Me.Unprotect("0010")
    or you can use
    ActiveWorkbook.ActiveSheet.Unprotect("0010")
    to use

     

    'Your code

     

    at the end of the procedure
    Me.Protect ("0010")
    or you can
    ActiveWorkbook.ActiveSheet.Protect("0010")
    to use.

     

     

    Hope I could help you with these information 

     

    NikolinoDE

    I know I don't know anything (Socrates)

Resources