Private Sub Workbook_Open()
Dim mdp$, x$, n As Byte
mdp = "toto" 'mot de passe à adapter
Do
x = Application.InputBox(IIf(n, "Il vous reste 1 essai :", "Vous avez droit à 2 essais :"), "Mot de passe")
n = n + 1
Loop While x <> mdp And n < 2
If x <> mdp Then Application.OnTime 1, Me.CodeName & ".Fermer"
End Sub
Sub Fermer()
Me.Saved = True
If Workbooks.Count = 1 Then Application.Quit Else Me.Close
End Sub