Save As / Overwrite

B

Brent E

Good Day,

I am using macros in an Excel file perform sorts on data and save each sort
type as a seperate html file. I want to be able to use this macro to perform
automatic updates.

If I use the Workbook.SaveAs command, I am constantly prompted whether to
overwrite the existing file. I do not want this box to appear.

Is there a variant to the Workbook.SaveAs command that automatically
overwrites a file with the same file name without prompting for a
yes/no/cancel?

Thanks,
 
M

Mike H

Hi,

Try something like this

Sub SaveMeeeee()
Application.DisplayAlerts = False
ThisWorkbook.SaveAs Filename:="MyFileName"
Application.DisplayAlerts = True
End Sub

Mike
 
B

Brent E

Thanks worked. Thanks Mike.

Mike H said:
Hi,

Try something like this

Sub SaveMeeeee()
Application.DisplayAlerts = False
ThisWorkbook.SaveAs Filename:="MyFileName"
Application.DisplayAlerts = True
End Sub

Mike
 

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