VBA .Saveas to overwrite existing file

Saqib Husain, Syed
Saqib Husain, Syed used Ask the Experts™
In VBA excel 2016 how do I Saveas the workbook so that it would overwrite any file existing with the same name?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

pls try

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:="YourFile.xlsx"
Application.DisplayAlerts = True

Open in new window

Great, thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial