Outputto action to automatically replace an excel file

G

Guest

When using the Outputto action I am promoted to confirm replacement of an
excel file. How can I use the macro to automatically replce without being
prompted?
 
G

Guest

I have done this but am still being prompted with the question to replace the
existing excel file.
 
C

Chris Reveille

Here is some code I got from Ken Snell a while back.

Set Warnings does not trap this Window message. You'll need
to use VBA code to avoid this message box. That code will
"Kill" the existing file and then put the new file in its
place -- all without warnings:

If Dir("C:\MyFolder\Filename.txt") <> "" Then Kill
"C:\MyFolder\Filename.txt"
DoCmd.OutputTo (.. rest of arguments)

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top