Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:01:00"), "MyMacro"
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime dTime, "MyMacro", , False
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Worksheets("NewMemo").Range("D2").Value = Now
End Sub
Public dTime As Date
Sub MyMacro()
Application.ScreenUpdating = False
dTime = Now + TimeValue("00:01:00")
Application.OnTime dTime, "MyMacro"
'YOUR CODE
ThisWorkbook.Save
Application.ScreenUpdating = True
End Sub
Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:01:00"), "MyMacro"
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime RunTime, "MyMacro", , False
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Worksheets("NewMemo").Range("D2").Value = Time
End Sub
Public RunTime As Date
Sub MyMacro()
Application.ScreenUpdating = False
RunTime = Now + TimeValue("00:01:00")
Application.OnTime RunTime, "MyMacro"
'YOUR CODE
ThisWorkbook.Save
Application.ScreenUpdating = True
End Sub