excel覆盖对话框关闭

时间:2010-12-16 07:36:38

标签: asp.net sql-server-2005

当我在asp.net,c#,sqlserver 2005

中使用下面的代码时,如何禁止覆盖对话框
                Worksheet sheet1 = (Worksheet)wb1.Worksheets["Sheet1"];
                Worksheet sheet2 = (Worksheet)wb2.Worksheets["temp"];

                sheet1.Copy(sheet2, missing);
                wb1.Close(true, Type.Missing, Type.Missing);
                wb2.SaveAs(dst, XlFileFormat.xlExcel3, Type.Missing, Type.Missing, Type.Missing, Type.Missing, XlSaveAsAccessMode.xlExclusive, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
                wb2.Close(true, Type.Missing, Type.Missing); 

1 个答案:

答案 0 :(得分:1)

你有没有试过像

这样的东西

Application.DisplayAlerts = false