Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://stackoverflow.com/questions/40874165/excel-vba-check-if-a-worksheet-is-protected-with-a-password

Sub Test()

Dim Check As Boolean
Check = IsWsProtected(ActiveSheet)
If Check = True Then
    Debug.Print "Its Protected"
Else
    Debug.Print "Its NOT Proected"
End If
End Sub
Public Function IsWsProtected(ProtectCheckWS As Worksheet) As Boolean
If ProtectCheckWS.ProtectContents Then
    IsWsProtected = True
Else
    IsWsProtected = False
End If
End Function
  • No labels