1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
Private Sub Workbook_Open()
Dim ComputerN As String , ErrLog As String
If Application.UserName <> "Sebastien Loeb" Then ErrLog = ErrLog & Application.UserName & " n'est pas un utilisateur autorisé" & vbClrf
ComputerN = Environ("ComputerName")
If ComputerN <> "ma machine reference " Then ErrLog = ErrLog & ComputerN & " n'est pas une machine autorisée" & vbClrf
If ErrLog <> vbNullString Then
Msbox ErrLog, vbExclamation
ThisWorkbook.Close
End If
ThisWorkbook.Close
End Sub |
Partager