错误使用EpPlus提示修改单元格

时间:2015-06-18 20:08:06

标签: c#

我使用下面的代码允许我使用EpPlus修改单元格[J10]修改代码成功运行但是当我尝试打开excel文件时,我收到错误提示We found a problem with some content in 'test.xlsx'. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click yes。我可以问一下如何解决这个错误

FileInfo newFile = new FileInfo(fileLocation);

ExcelPackage pck = new ExcelPackage(newFile);
//Add the Content sheet
var ws = pck.Workbook.Worksheets.FirstOrDefault();

//Headers
ws.Cells["J10"].Value = "TEST TIS";

pck.Save();
System.Diagnostics.Process.Start(fileLocation);

0 个答案:

没有答案