The below segment of code works fine, but if the file already exists, it asks if you want to overwrite or not. If I say yes, it works fine. If I say no, it gives the error, "Method save as object_workbook failed". What can I do to handle this exception?
![]()
ActiveWorkbook.SaveAs fileName:= _ "J:\Reports\WeeklySafeLink\" & stYear & "\" & stYear & stMonth & "\" & stYear & stMonth & stDay & "\" & "TracFone Commission.xlsx", _ FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
Bookmarks