Hi
I am calling the method to perform a Save As with a filename I am building in the code.
ActiveWorkbook.SaveAs Filename:= _
FilePath & NewFileName, FileFormat:= _
xlOpenXMLWorkbook, ReadOnlyRecommended:=True, CreateBackup:=False
FilePath and NewFileName are populated with valid data.
If the file exists I get a warning message asking if I want to overwrite the file.
If I click Yes, all works fine and the file is over-written. However if I click 'No' I get the error:
Alternatively, how do I prompt the user to choose their own filename and then do the Save based on the folder and filename they have entered?
I am calling the method to perform a Save As with a filename I am building in the code.
ActiveWorkbook.SaveAs Filename:= _
FilePath & NewFileName, FileFormat:= _
xlOpenXMLWorkbook, ReadOnlyRecommended:=True, CreateBackup:=False
FilePath and NewFileName are populated with valid data.
If the file exists I get a warning message asking if I want to overwrite the file.
If I click Yes, all works fine and the file is over-written. However if I click 'No' I get the error:
Run-time error '1004'
Method 'SaveAs' of object '_Workbook'
How can I check if the user has clicked 'No' and prevent the error/debug window?Method 'SaveAs' of object '_Workbook'
Alternatively, how do I prompt the user to choose their own filename and then do the Save based on the folder and filename they have entered?