Forum Discussion
esatyilmaz
Jul 14, 2022Copper Contributor
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 ...
- Jul 14, 2022
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
I know I don't know anything (Socrates)
NikolinoDE
Jul 14, 2022Platinum Contributor
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
I know I don't know anything (Socrates)
esatyilmaz
Jul 14, 2022Copper Contributor
Hi Niko, thank you very much. That worked!