can someone fix this for me please: keep getting rutime error 1004 Application.OnTime
**in the ThisWorkbook section
Option Explicit
Private Sub Workbook_Open()
macro1
End Sub
**in a module
Option Explicit
Sub macro1()
Application.OnTime Now + TimeValue("00:00:01"), "sveIt" '<-- this tells the macro, in 5 seconds run yourself again. 'place your other code here
End Sub
Sub sveIt()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim dt As String
dt = Format(Now(), "mm-dd-yyyy hh.mm.ss")
ThisWorkbook.SaveAs Filename:="\\MY DIRECTORY\dt.xlsm"
Application.ScreenUpdating = True
Application.DisplayAlerts = True
macro1
End Sub
Bookmarks