SaveAs without prompt

S

Steven K0

Hello,

Is there a way to overwrite a file with SaveAs without being prompted with a
dialog box? Or do you have to delete the file first and then save?
 
N

Norman Jones

Hi Steven,

Try:

Sub Test()
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs "YourFileName" '<<<== CHANGE
Application.DisplayAlerts = True

End Sub
 
G

Gord Dibben

Application.DisplayAlerts = False

"your code

Application.DisplayAlerts = True

Gord Dibben Excel MVP
 

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