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);
激活工作表

上一篇:GO通道和 sync 包的分享


下一篇:day20-自动化办公2