净Excel的互操作删除工作表操作、工作、Excel

由网友(︶ㄣ小星星〔★))分享简介:我想从.NET删除一个excel文件的工作表的C#3.5的应用程序与互操作Excel的类(Excel 2003中)。I'm trying to delete a worksheet from a excel document from a .Net c# 3.5 application with the intero...

我想从.NET删除一个excel文件的工作表的C#3.5的应用程序与互操作Excel的类(Excel 2003中)。

I'm trying to delete a worksheet from a excel document from a .Net c# 3.5 application with the interop Excel class (for excel 2003).

我尝试了很多的东西,如:

I try many things like :

Worksheet worksheet = (Worksheet)workbook.Worksheets[1];
worksheet.Delete();

这不工作,不抛出任何错误...

It's doesn't work and doesn't throw any error ...

推荐答案

在一个多小时的样子,我找到了答案:

After more than one hour looking I found the answer:

xlApp.DisplayAlerts = false;
worksheet.Delete();
xlApp.DisplayAlerts = true;
阅读全文

相关推荐

最新文章