sarahmichelle
New Member
- Joined
- Jul 29, 2021
- Messages
- 1
- Office Version
- 365
- 2016
- Platform
- Windows
Hi All
I have been researching how to resolve my Application.OnTime issues with regards to my VBA code but have not had any luck. My code does not execute at all.
I am not experienced with VBA, but simply want my workbook to save to a drive 4 times a day. Thus, I have the below code repeated 4 times in VBA for each time I wish to save my file & with different file names. Is there any alternative to Application.OnTime that I can use to carry out this purpose?
Sub SaveWorkbookAM()
Application.OnTime TimeValue("01:00:00"), "AMmacro"
End Sub
Sub AMmacro()
Dim MyFilePath As String
Dim MyFileDate As String
Dim MyFileName As String
MyFilePath = "Y:\Tissue Furnish Tracker\"
MyFileDate = Format(Date, "mm-dd-yyyy")
MyFileName = MyFilePath & MyFileDate & "_Dayshift.xlsm"
ActiveWorkbook.SaveCopyAs Filename:=MyFileName
End Sub
Please help. Thanks.
I have been researching how to resolve my Application.OnTime issues with regards to my VBA code but have not had any luck. My code does not execute at all.
I am not experienced with VBA, but simply want my workbook to save to a drive 4 times a day. Thus, I have the below code repeated 4 times in VBA for each time I wish to save my file & with different file names. Is there any alternative to Application.OnTime that I can use to carry out this purpose?
Sub SaveWorkbookAM()
Application.OnTime TimeValue("01:00:00"), "AMmacro"
End Sub
Sub AMmacro()
Dim MyFilePath As String
Dim MyFileDate As String
Dim MyFileName As String
MyFilePath = "Y:\Tissue Furnish Tracker\"
MyFileDate = Format(Date, "mm-dd-yyyy")
MyFileName = MyFilePath & MyFileDate & "_Dayshift.xlsm"
ActiveWorkbook.SaveCopyAs Filename:=MyFileName
End Sub
Please help. Thanks.