Sub TestProtection()
Static t# 'mémorise la variable
Dim Sh As Object, test As Boolean
On Error Resume Next
Application.OnTime t, "TestProtection", , False 'RAZ de sécurité
Set Sh = ThisWorkbook.ActiveSheet
test = Sh.ProtectContents
With Sh.[B5] 'cellule à adapter
.Value = "Feuille " & IIf(test, "", "non ") & "protégée"
.Interior.Color = IIf(test, vbGreen, vbRed)
.Font.Color = IIf(test, vbBlack, vbWhite)
End With
ThisWorkbook.Saved = True 'évite l'invite à la fermeture
t = Now + 1 / 86400 'temporisation 1 seconde
Application.OnTime t, "TestProtection" 'relance le processus
End Sub