ExcelPackage读取写入

需要库EPPlus.dll
引用空间名称using OfficeOpenXml;
//创建一个Excel
using (var p = new ExcelPackage())
{
var sheet = p.Workbook.Worksheets.Add("CombatTurn");
int row = 0;
//赋值
sheet.Cells[row, 1].Value = https://www.it610.com/article/1;
p.SaveAs(new FileInfo(@"D:\编辑器导出测试.xlsx"));
}
FileInfo newFile = new FileInfo(@"D:\编辑器导出测试.xlsx");
//读取EXCEL
using (var p = new ExcelPackage(newFile))
{
//读取页签
var sheet = p.Workbook.Worksheets["CombatTurn"];
//修改EXCEL
sheet.Cells[1, 1].Value = https://www.it610.com/article/2;
//保存
p.Save();
//行边界
Debug.Log("Rows : " + sheet.Dimension.End.Row.ToString());
//列边界
Debug.Log("Columns : " + sheet.Dimension.End.Column.ToString());
【ExcelPackage读取写入】}

    推荐阅读