.Net Excel Interop Deleting a worksheet

后端 未结 7 774
深忆病人
深忆病人 2020-12-01 17:53

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 :

<
7条回答
  •  一个人的身影
    2020-12-01 18:39

    Try to find worksheet by name:

    var app = new Microsoft.Office.Interop.Excel.Application();
    var workbook = app.Workbooks.Add();
    ((Microsoft.Office.Interop.Excel.Worksheet)workbook.Worksheets["Sheet3"]).Delete();
    

提交回复
热议问题