Enzo_Matrix
Board Regular
- Joined
- Jan 9, 2018
- Messages
- 113
I wrote some code to protect all my sheets at once with a password and it works great when executed with F5.
when I try to unprotect the sheets manually with the same password I get the error message:
"The password you supplies is not correct. Verify that the CAPS LOCK key is off and be sure to use correct capitalization."
So I wrote the exact same code but with 'unprotect'.
Any ideas why it won't let me unprotect my sheets manually?
when I try to unprotect the sheets manually with the same password I get the error message:
"The password you supplies is not correct. Verify that the CAPS LOCK key is off and be sure to use correct capitalization."
So I wrote the exact same code but with 'unprotect'.
Any ideas why it won't let me unprotect my sheets manually?
Code:
Sub ProtectAll()
For Each sht In ActiveWorkbook.Sheets
sht.Protect Password = "123"
Next
End Sub
Sub unlockall()
For Each sht In ActiveWorkbook.Sheets
sht.Unprotect Password = "123"
Next
End Sub