export query to excel macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all.
I have a db that holds thousands of records. I have a query that pulls the
top 10 records using a begin date and end date as criteria. I want to export
the data to excel via a macro activated by the switchboard. I have created
the macro, and all works well, except I have one, for lack of a better word,
annoyance.

I have named a file to output to in the macro, and have setwarnings to "no".
I'm getting a dialog box asking is it ok to overwrite the existing file with
the new output. How do I set the macro to answer that as a "yes" every time
so that the macro runs smoothly without confusing the users?

Thank you all for your help!
bc
 
Thanks Chris. That's a good answer, but hardly practical, because the user
would have to do that manually each time before running the macro. If the
macro could be setup to delete the file first, on the other hand, that would
do it. However, I don't see the functionality in the Access Macro group to
delete a file outside of Access.

Any other ideas that may work?

Thanks.
bc
 
Back
Top