I could use some help debugging a macro I am trying to make that saves a new version of the workbook with the current date (e.g. 06-Jun-22_Macro Tests).
I keep getting the error Run-time error 1004 Method 'SaveAs of object '_Workbook' failed.
Here is what I have. Any help is appreciated!
Sub Save_New_WB()
'
' Save_New_WB to save a current version of the workbook with the date
'
' Define Variable Types
Dim path As String
Dim filename_new As String
' Folder where file should be saved
path = "/Users/chlowin1/Desktop/Wildbird Engineering/Save Updates Here/"
' File name with current date
filename_new = Format(Now, "dd-mmm-yy") & "_Macro Tests"
' Save as new file
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs filename:=path & filename_new, FileFormat:=52
Application.DisplayAlerts = True
ActiveWorkbook.Close
End Sub
I keep getting the error Run-time error 1004 Method 'SaveAs of object '_Workbook' failed.
Here is what I have. Any help is appreciated!
Sub Save_New_WB()
'
' Save_New_WB to save a current version of the workbook with the date
'
' Define Variable Types
Dim path As String
Dim filename_new As String
' Folder where file should be saved
path = "/Users/chlowin1/Desktop/Wildbird Engineering/Save Updates Here/"
' File name with current date
filename_new = Format(Now, "dd-mmm-yy") & "_Macro Tests"
' Save as new file
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs filename:=path & filename_new, FileFormat:=52
Application.DisplayAlerts = True
ActiveWorkbook.Close
End Sub