How can I improve upon this code to apply logic based on the user's response to a SaveAs Dialog Box 'do you want to overwrite existing file' question:Sub SaveFile(fName As String)cancelSave = FalseRetry:saveAsFileName = Application.GetSaveAsFilename(InitialFileName:=fName, FileFilter:=Excel Files (*.xlsx), *.xlsx)If saveAsFileName <> False Then    If Not Dir(saveAsFileName) <> vbNullString Then        ActiveWorkbook.SaveAs fileName:=saveAsFileName    Else        On Error Resume Next        ActiveWorkbook.SaveAs fileName:=saveAsFileName, FileFormat:=xlWorkbook, ConflictResolution:=xlLocalSessionChanges        If Err.Number = 1004 Then            On Error GoTo 0            GoTo Retry        Else            On Error GoTo 0        End If    End IfElse    cancelSave = TrueEnd IfEnd Sub
Error Trapping for dialog box reply
vba;excel