OutputTo with same name

R

rml

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.
 
C

Chris Reveille

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
 

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