OutputTo with same name

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

Guest

I have a macro that runs every night and the file name is
123.htm. I would like to be able to over right this file with the same name
without be promted. I have suppress all warnings but still get promted.

Thanks.
 
This is from ken Snell.
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