VBA Compiler how to protect and unprotect Sheets

what syntax does the VBA Compiler accept to protect and unprotect a sheet?
I get “Please open the VBA compiler of XLS Padlock and recompile your code.” with:
ActiveSheet.unprotect Password:=“xyz”
Thank you very much!

All access to Excel objects such as ActiveSheet must be preceded with Application.

Thank you very much. That’s great. It works fine!!!

1 Like