mattygriff
Programmer
I have an application which automatically generates a file name based on report number and a couple of other parameters. Occasionally, this throws up an issue where the filename generated has already been created and Excel asks whether the user wants to overwrite the existing file.
If the user selects Yes then everything works fine and the file is saved but if they select No then I get an error that "Method 'SaveAs' of object '_Workbook' failed".
Is there a way that I can check whether the generated filename has already been created? The files are always saved in the same directory, if that helps.
TIA.
If the user selects Yes then everything works fine and the file is saved but if they select No then I get an error that "Method 'SaveAs' of object '_Workbook' failed".
Is there a way that I can check whether the generated filename has already been created? The files are always saved in the same directory, if that helps.
TIA.