Sheet protection

  • Thread starter Thread starter OK
  • Start date Start date
O

OK

Could someone please supply me with the VBA to test and
determine if a sheet is protected or not?

Also, if a workbook is protected or not?

Two functions that return a boolean is what I'm after...

Thanks much.
 
Try this

Sub Test()
If ActiveSheet.ProtectContents = True Then
MsgBox "Protect"
Else
MsgBox "not protect"
End If
End Sub

For the workbook use
ActiveWorkbook.ProtectStructure = True
 
Back
Top