Bonsoir Rocket 4 le forum
bon alors voilà tu as deux possibilités la macro en direct ou l'appel à la function, bien plus compliqué pour obtenir le même résultat !!a toi de choisir
a+
Papou
Sub Vérifier() ' voilà donc la macro en direct plus simple
If ThisWorkbook.ProtectStructure Then
MsgBox "Oui Ton Fichier et Protégé", , "Fichier Bien Protégé"
Else
MsgBox "Bon Ton Fichier n'est pas Protégé!!", , "Fichier pas Protégé"
End If
End Sub
Sub vérifier1() 'là voilà ta macro qui fait appel à la fonction isprotected
If IsProtected(ThisWorkbook) Then
MsgBox "Oui Ton Fichier et Protégé", , "Fichier Bien Protégé"
Else
MsgBox "Bon Ton Fichier n'est pas Protégé!!", , "Fichier pas Protégé"
End If
End Sub
Function IsProtected(objXL As Object) As Boolean 'et là la fonction isprotected
If objXL.ProtectStructure Then
IsProtected = 1
Else
IsProtected = 0
End If
End Function