Application.DisplayAlerts = False
' Your save code
Application.DiplayAlerts = True
Should take care of it for you.
HTH,
Smitty
This is a discussion on code to skip excel save as overwrite prompt within the Excel Questions forums, part of the Question Forums category; I have a code that uses savas to back up a file. first it saves it then it does a ...
I have a code that uses savas to back up a file. first it saves it then it does a save as to back it up. however i dont want a new file every time its saved. i just want to save as a certain name and write over it each time. is there a way to avoid the prompt that says a file with that name already exsists do you wish to overwrite it?
Application.DisplayAlerts = False
' Your save code
Application.DiplayAlerts = True
Should take care of it for you.
HTH,
Smitty
Here is the code I put that into:
ActiveWorkbook.Save
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:=Range("B299")
Application.DiplayAlerts = True
And this is what I get:
Run time error '438'
Object doesnt support this property or method
It them hilights the line:
Application.DiplayAlerts = True
Any suggestions?
Yup...My bad spelling is to blame...
Application.DiplayAlerts = True
Should be:
Application.DisplayAlerts = True
Thanks![]()
Thanks for keeping this posted. Four years later it helped me!!
sorry, mis-cliked and can't delete the reply
Bookmarks