is to delete it before saving it. That can be done in a single macro step before you open and save the report.
Steps:
1. Make a batchfile, for example c:\mydatabase\data\delete.bat with just one line in it: del c:\mydatabase\export\mytable.xls
Use Notepad to make and save this batchfile.
2. Make a Runapp-step in the macro with full path to batchfile as parameter.
This will execute the batchfile, and the batchfile will delete the workbook.
There must be other - more elegant - solutions, but I just made and tested this (Windows XP, Access 2000) in 5 minutes or so, and I'm content with the way it works. I leave it to others to find something better.
Note that exporting a table as a spreadsheet overwrites an existing one without asking. But as you're talking about a report that's not relevant. By the way, can you tell me the code to do so?
Hope this helps.
Kees
i am writing a macros in access that exports a report to excel and attaching that macro to a button on a form. because this file in excel will be overwritten each month, I would like to add in the macro a step that saves over the original file without the "do you want to replace the existing file" message... Is this possible.
thanks !
rob kormoski

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic