Private Sub Workbook_Open()
Dim j As Integer
For j = 1 To 3
mdp = InputBox("Entrer mot de passe :", "Mot de passe d'ouverture:")
If mdp = "0000" Then
Sheets("Index").Activate
Range("A1").Select
Exit For
Else
MsgBox "Mot de passe incorrect", vbCritical + vbOKOnly, "Erreur"
If j >= 3 Then
MsgBox "Vous avez droit à 3 tentatives, l'applicatif sera fermé !"
ActiveWorkbook.Close
End If
End If
Next
End Sub