导出Excel所引用的dll,Aspose.Cells.dll下载地址:​

/// <summary>
/// 删除Excel多行
/// </summary>
/// <param name="ExcelPath">Excel路径</param>
/// <param name="SheetName">Sheet表名</param>
/// <param name="RowNumber">删除多行,注意删除的顺序必须为倒序(RowNumber="4,3,2,1,0")</param>
/// <returns></returns>
public static bool DeleteRow(string ExcelPath, string SheetName, string RowNumber)
{
bool isDelete = false;
try
{
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook();
workbook.LoadData(ExcelPath);
Aspose.Cells.Worksheet sheet = workbook.Worksheets[SheetName];

string[] InputStr = RowNumber.Split(',');

foreach (string item in InputStr)
{
sheet.Cells.DeleteRow(int.Parse(item));
}

workbook.Save(ExcelPath);

isDelete = true;
}
catch (Exception)
{
isDelete = false;
}
return isDelete;
}