Private Sub Workbook_Open()
Application.OnTime 1, Me.CodeName & ".Decompte" 'lance le processus
End Sub
Sub Decompte()
Dim delai#, cel As Range, t#
delai = 50 'en secondes
Set cel = [F3]
t = Timer + delai
ActiveSheet.Protect "toto", UserInterfaceOnly:=True 'mot de passe à adapter
On Error Resume Next
While Timer < t And t < 86400
cel = (t - Timer) / 86400
DoEvents
Wend
Me.Save
If Workbooks.Count = 1 Then Application.Quit Else Me.Close
End Sub