I use the following protect/unprotect Macros in all of my files that need to be edited by multiple users. They work like a charm, except for the most recent file I have been working on.
____________________________________________
Sub Protect()
'stops screen updating
Application.ScreenUpdating = False
'protects locked cells
For Each sht In ActiveWorkbook.Sheets
sht.Protect Password:="teslinoor", DrawingObjects:=False, Contents:=True, Scenarios:= _
True, AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:= _
True
Next
ActiveWorkbook.Protect Password:="teslinoor", Structure:=True
End Sub
_________________________________
Sub Unprotect()
'stops screen updating
Application.ScreenUpdating = False
'unprotects locked cells
For Each sht In ActiveWorkbook.Sheets
sht.Unprotect Password:="teslinoor"
Next
ActiveWorkbook.Unprotect Password:="teslinoor"
End Sub
____________________________________________
I keep getting the "Error 1004" Error that states, "The password you supplied is not correct. Verify that the CAPS LOCK key is off and be sure to use the correct capitalization."
I have ensured that CAPS LOCKS is off (and I have even tried it with it on) and I have been careful to use the same capitalization. Additionally, when locked, this file needs to remain sortable.
Any help would be apprecaited.
-JT
Bookmarks