C#调用excel-1
作者:互联网
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);
激活工作表
标签:调用,wb,Office,C#,excel,Excel,xlApp,Interop,Microsoft 来源: https://www.cnblogs.com/3118460692wwx/p/15195856.html