Hello everyone,
I'm having a problem with protecting cells via VBA and I hope you can help me.
I have the following code written, which protects locked cells with password.
However, the issue is that it is still possible for users to manually unprotect the cells without password via review-unprotect sheet.
Can someone please help to explain why the password protection is not working properly?
Dim ws As Worksheet
Set wsarray = Sheets(Array(xxx"))
For Each ws In wsarray
ws.EnableOutlining = True
ws.Protect UserInterfaceOnly:=True
ws.Protect Password = "pwd"
ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowFiltering:=True, AllowUsingPivotTables:= _
True
Next
I'm having a problem with protecting cells via VBA and I hope you can help me.
I have the following code written, which protects locked cells with password.
However, the issue is that it is still possible for users to manually unprotect the cells without password via review-unprotect sheet.
Can someone please help to explain why the password protection is not working properly?
Dim ws As Worksheet
Set wsarray = Sheets(Array(xxx"))
For Each ws In wsarray
ws.EnableOutlining = True
ws.Protect UserInterfaceOnly:=True
ws.Protect Password = "pwd"
ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowFiltering:=True, AllowUsingPivotTables:= _
True
Next