文件名称:C#操作Excel电子表格
文件大小:35KB
文件格式:DOC
更新时间:2014-09-29 15:53:27
C# 操作 Excel 电子表格
★打开Excel文件============================ Microsoft.Office.Interop.Excel.Application excel1 = new Microsoft.Office.Interop.Excel.Application(); Workbook workbook1 = excel1.Workbooks.Open(@"E:\aaa.xls", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); excel1.Visible = true; ★新建Excel对象============================ Microsoft.Office.Interop.Excel.Application excel1 = new Microsoft.Office.Interop.Excel.Application(); Workbook workbook1 = excel1.Workbooks.Add(XlWBATemplate.xlWBATWorksheet或true); worksheet1.Activate();//激活sheet1表 excel1.Visible = true;