Code: Select all
Public Function Cht_Or_Protected() As Boolean
Dim ws As Worksheet
On Error Resume Next
Set ws = ActiveSheet
If Err Then
On Error GoTo 0
Cht_Or_Protected = True
GoTo ExitHandler
End If
Cht_Or_Protected = ws.ProtectionMode
ExitHandler:
Set ws = Nothing
End Function