Private Sub Workbook_Open()
Dim numfich As Integer
Dim us As String, Fichier$
'creation du fichier vide = status.txt dans ThisWorkbook.Path ?
Fichier = ThisWorkbook.Path & "\ Status.txt"
If Dir(Fichier) = "" Then
numfich = FreeFile
Open Fichier For Output As #numfich
Print #numfich, Application.UserName & " le " & Now() ' pose du fichier
Close #numfich
Else
numfich = FreeFile
Open Fichier For Input As #numfich
Input #numfich, us
Close #numfich
MsgBox "Fichier en lecture seule !" & vbLf & "Utilisé par " & Application.IfError(Application.VLookup(us, Sheets("Acc").Range("X2:Y3"), 2, False), us) ' info
End If
End Sub