Hi

I'm trying to save a workbook with a name related to a cell using the following code: -

Sub Savepath()

Dim FPATH As String
FPATH = "T:\PERSONAL FOLDERS\STEVO56\ILS Test Rig Phase 1\Test Spreadsheet Dump\"
ActiveWorkbook.SaveAs FPATH & Range("R5").value & ".XLSM", FileFormat:=52

End Sub

When the macro runs, it saves perfectly as required, however if a file already exists with that name the excel prompt asking to overwrite Yes/No/Cancel, yes works fine but no and cancel display a Run-time error'1004': Method 'SaveAs' of object'_Workbook' failed.

If you select No or Cancel I would just like it to exit the sub.

Any help would be appreciated, Thanks in advance.

Steve