Excel - SaveAs Overwrite...

JaedenRuiner

Well-known member
Joined
Aug 13, 2007
Messages
340
Programming Experience
10+
Is there a way to execute a Excel.WorkBook.SaveAs() so that it overwrites any existing file automatically.

I tried:
VB.NET:
_wb.SaveAs(filename, ConflictResolution:=Excel.XlSaveConflictResolution.xlLocalSessionChanges)

But that still pops up a user input dialog box. I want to just do it automatically.

Thanks
 
Looks like they all say to set theExcel.DisplayAlerts = False. You could also use the System.IO.File tools to delete the file if it exists.
 
Overwrite Excel File

You might be able to save the workbook with SAVE instead of SAVE AS. In this way no prompt message for authorizing overwriting will be shown.
 
Back
Top