Outputto action to automatically replace an excel file

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
I have done this but am still being prompted with the question to replace the
existing excel file.
 
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
 
Back
Top