Excel.ApplicationClass excel=new Microsoft.Office.Interop.Excel.ApplicationClass();
Type excelType=excel.GetType();
Excel.Workbooks workbooks=excel.Workbooks;
excel.Visible=true;
// 打开文件
Type workbooksType=workbooks.GetType();
object temp="c:\\test.xlt";
Excel.Workbook workbook=(Excel.Workbook)workbooksType.InvokeMember("Add",System.Reflection.BindingFlags.InvokeMethod,null,workbooks,new object[]{temp});
}
浙公网安备 33010602011771号