Private Sub Workbook_Open()
Dim n As Byte, T As String, MdP
n = 4: T = " pour entrer le mot de passe"
Do
n = n - 1
MdP = InputBox(n & " essai" & IIf(n > 1, "s", "") & T, "Attention ...")
If n = 1 Then
MsgBox "Le classeur va se fermer !", 16, "C'est fini..."
ThisWorkbook.Close 0 'voir l'aide
End If
Loop Until MdP = "123" 'ou autre
End Sub