Dim t# 'mémorise la variable
Private Sub Workbook_Open()
ReactiveMacros 'lance le processus
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Not Me.Saved Then Me.Save 'enregistrement
On Error Resume Next
Application.OnTime t, Me.CodeName & ".ReactiveMacros", , False 'arrête le processus
End Sub
Sub ReactiveMacros()
On Error Resume Next
Application.OnTime t, Me.CodeName & ".ReactiveMacros", , False
t = Now + 5 / 86400 'délai de 5 secondes
Application.OnTime t, Me.CodeName & ".ReactiveMacros"
End Sub