Using EPPlus Excel - How to ignore excel error checking or remove green tag on top left of the cell

前端 未结 7 1709
孤街浪徒
孤街浪徒 2020-12-13 16:29

I use EPPlus to export excel 2007 file. The file can export normally but i have some problem with setting column format. My string column with numeric style (Purchase Order

7条回答
  •  被撕碎了的回忆
    2020-12-13 16:56

    In addition to @briddums' answer, from EPPlus 5 you can ignore errors and there is no need to touch the EPPlus source.

    var p = new ExcelPackage();
    var ws = p.Workbook.Worksheets.Add("IgnoreErrors");
    
    ws.Cells["A1"].Value = "1";
    ws.Cells["A2"].Value = "2";
    var ie = ws.IgnoredErrors.Add(ws.Cells["A2"]);
    ie.NumberStoredAsText = true;   // Ignore errors on A2 only
    

提交回复
热议问题