interop
string exportExcelPath = "export.xlsx";
Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application();
xlApp.Visible = false;
TaskDialog.Show("revit", "0");
Microsoft.Office.Interop.Excel.Workbooks wbs = xlApp.Workbooks;
Microsoft.Office.Interop.Excel._Workbook wb = wbs.Add(exportExcelPath);
//wb.Close();
//wbs.Close();
// xlApp.Quit();
//System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp);//释放进程
Microsoft.Office.Interop.Excel._Worksheet wb1 = wb.Sheets[1];
//Microsoft.Office.Interop.Excel._Worksheet wb2 = wb.Sheets[2];
//string Name = wb2.Name;
//int sRowcount = wb1.Rows.Count;
//Console.WriteLine(Name);
激活工作表