ThisWorkbook
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call StopTick
ThisWorkbook.Save
End Sub
Private Sub Workbook_Open()
Call StartTick
End Sub
Module1
Dim Cas As Date
Sub TimerTick()
Application.ScreenUpdating = False
ThisWorkbook.Save
Application.ScreenUpdating = True
Call StartTick
End Sub
Sub StopTick()
ThisWorkbook.Save
On Error Resume Next
Application.OnTime EarliestTime:=Cas, Procedure:="TimerTick", Schedule:=False
End Sub
Sub StartTick()
Cas = Now() + TimeValue("00:00:03")
Application.OnTime EarliestTime:=Cas, Procedure:="TimerTick", Schedule:=True
End Subcitovat