Write over existing file with no Prompt

D

DNewton

Hi All,
I have several macros that bring up a text file, format it, and the
save it as an Excel file. If the macro has been run before, and th
Excel file is already there, I am prompted with a message that the fil
already exists, do I want to replace it?

How do I get the macro to replace the file without prompting? I hav
lived with this for quite some time, and when I have a large number o
files, this gets quite aggravating!!

Thanks,
Don Newto
 
K

kkknie

Before the line of code that saves the file place this line:

Application.DisplayAlerts = False

and after the file saving line place:

Application.DisplayAlerts = True
 
D

DNewton

kkknie,
Absolutely fantastic!! It worked perfectly. I can't tell you what
timesaver this will be.

Thanks!
 
Top