Replace an Existing File

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

Guest

I am working on an application in VBA that will read in yesterday's file,
save it as filename_OLD.xls, then replace the data in it with today's data
and save it as filename.xls. How do I replace the existing filename_OLD.xls
without having any messages or prompts appear? The VBA help tells me
everything except what I want to know. I've tried .SaveAs and doing a
..DeleteFile before saving the new version, but I've had problems with both.
 
Hi Jim

If you want to overwrite the file then you can use

Application.DisplayAlerts = False
'SaveAs code
Application.DisplayAlerts = True
 
Thank you. Turns out that I was also trying to write to a directory to which
I had only read-access. Makes things difficult :-)

Jim
 
Back
Top