Try setting the Application.DisplayAlerts
property to false
. You may find it useful to set this property to false
for the majority of your automation routines. Remember to restore the previous value before returning.
Application applicationInstance = ...;
var oldDisplayAlertsValue = applicationInstance.DisplayAlerts;
applicationInstance.DisplayAlerts = false;
try
{
outputExcelWorkBook.Close(false, Missing.Value, Missing.Value);
}
finally
{
appliationInstance.DisplayAlerts = oldDisplayAlertsValue;
}