I have workbook that has a button to archive the current status of the file in a different location. Right now, am using the SaveCopyAs command to save the new copy. The problem I am running into is that if the archive copy has already been done, it gets overwritten. I would like to stop the macro if the file being saved already exists (will add a MsgBox to inform user of what is happening). Any help would be appreciated.
VBA Code:
Sub Test ()
Dim FilePath As String, ArchWB As String
FilePath = Environ("userprofile") & "\Reports"
ArchWB = "Report_" & Format(Date, "YYYY") - 1 & ".xlsm"
ThisWorkbook.SaveCopyAs Filename:= FilePath & "\" & ArchWB
' If file already exists, I would like to have a message pop-up, alerting user, then cancel the save
End Sub