SaveAs Method

  • Thread starter Thread starter Geoff
  • Start date Start date
G

Geoff

Is there an argument or way to automatically overwrite an existing file
without receiving the overwrite confirmation message using the SaveAs method
 
Hi
enclose the SaveAs method with the following two statements:
Application.displayalerts = false
' your saveas method
Application.displayalerts = True
 
sFile = "C:\myfolder\Myfile.xls"
On error resume next
kill sFile
On error goto 0
activeworkbook.SaveAs sFile
 
Back
Top