你应该看看设置
原文链接:https://www.f2er.com/vb/255562.htmlDisplayAlerts=false
Application.DisplayAlerts Property
Set this property to False if you
don’t want to be disturbed by prompts
and alert messages while a program is
running; any time a message requires a
response,Microsoft Excel chooses the
default response.
一旦完成,请记住将其重置为true.
我们目前这样做如下
object m_objOpt = Missing.Value; m_Workbook.Application.DisplayAlerts = false; m_Workbook.SaveAs( fileName,m_objOpt,XlSaveAsAccessMode.xlNoChange,XlSaveConflictResolution.xlLocalSessionChanges,m_objOpt);