VBA .Saveas to overwrite existing file

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

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
Hi,

pls try

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

Open in new window

Regards
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