본문 바로가기

Error Notes

How to use workbook.saveas with automatic Overwrite

반응형

stackoverflow.com/questions/36542088/overwrite-existing-file-excel-vba

 

overwrite existing file excel vba

open_book.SaveAs Filename:="E:\MF\data\" & com_tick_ask & ".xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False This is my code to save a file as xlsx but I want to overwrite an exis...

stackoverflow.com

 

 

 

Sorry friends for trouble. I got an answer.

I just have to put this line of code immediately before my SaveAs statement...

Application.DisplayAlerts = False

and have to put this line of code immediately after it...

Application.DisplayAlerts = True

e.g.

 

 

Application.DisplayAlerts = False

open_book.SaveAs Filename:="E:\MF\data\" & com_tick_ask & ".xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False

 

Application.DisplayAlerts = True

 

 

www.youtube.com/watch?v=pJnOCnpLOcU

 

반응형