I am working on a project that saves Excel files with a variable name (File_Name) to designated folder. I need to also need to save a backup file to a separate designated folder with out overwriting the original file. I have tried SaveCopyAs but it keeps overwriting the original file. Help!! The code I am using to save the file is listed below.
Sub SaveAs()
'
' SaveAs Macro using a name from a cell and a set file path
'
If Range("File_Name") = "" Then
MsgBox "Please Enter The Required Information"
Exit Sub
End If
fname = Range("File_Name").Value
fileSaveName = Application.GetSaveAsFilename(InitialFileName:=FilePath" & fname, _
FileFilter:="Excel Workbook (*.xls), *.xls")
If fileSaveName <> False Then
On Error GoTo errhandler
ActiveWorkbook.SaveAs fileSaveName
MsgBox "The Manual Dispatch has been saved."
End If
Exit Sub
errhandler: MsgBox "THE FILE HAS NOT BEEN SAVED !", , "WARNING"
End Sub
Bookmarks