Modify excel cell

后端 未结 5 1045
轮回少年
轮回少年 2020-12-31 18:54

Good morning, I would like to edit some cells from already existing excell file. I tried use EPPlus and normal OpenXml classes. However I failed. In both situation program w

5条回答
  •  情话喂你
    2020-12-31 19:28

    I'm using ClosedXML where updating a cell value is a no-brainer:

    var workbook = new XLWorkbook("HelloWorld.xlsx"); // load the existing excel file
    var worksheet = workbook.Worksheets.Worksheet(1);
    worksheet.Cell("A1").SetValue("Hello World!");
    workbook.Save();
    

    The NuGet package can be found here.

提交回复
热议问题