Esteemed Forum Participants and Lurkers:
========================================
EXCEL SaveAs Function Returns
I'm doing a SaveAs in my EXCEL VBA program:
aworkbook.SaveAs fileName:="TEST.xls"
If the file already exists, a modal dialog box pops up with the message:
A file named 'TEST.xls' already exists in this location. Do you want to replace it?
... and 3 buttons: Yes No Cancel
If Yes is selected, the program continues normally.
If No or Cancel is selected, the program aborts into MS Visual Basic with the message:
Run-time error '1004': Method 'SaveAs' of object '_Workbook' failed
How can I determine the returns from the No and Cancel buttons and process these returns in my program without having the program abort?
Thank you for your gracious comments, suggestions, and assistance.




Reply With Quote