using Aspose.Cells; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; namespace Sheets.common { public class OperateExcel { /// <summary> /// 导出的文件保存到这里 /// </summary> private static string
1.添加引用: Aspose.Cells.dll(我们就叫工具包吧,可以从网上下载.关于它的操作我在“Aspose.Cells操作说明 中文版 下载 Aspose C# 导出Excel 实例”一文中的说.这里你暂时也可不理会它.) 即使没有安装office也能用噢,这是一个好强的大工具. 2.编写Excel操作类 using System; using System.Collections.Generic; using System.Text; using Aspose.Cells; using
public class AsposeCellsHelper { public Workbook workBook; public Worksheet worksheet; Style style; /// <summary> /// 构造函数,不设置工作表名称 /// </summary> public AsposeCellsHelper() { workBook = new Workbook(); worksheet = workBook.Worksheets[0]; } //