在我的下面代码中,c4的值为零。C4单元格有一个SUM(C2:C3)函数。EPPlus可以读取带公式的单元格吗?为什么c4被设为0而不是12?
using (var package = new ExcelPackage(existingFile))
{
ExcelWorkbook workBook = package.Workbook;
var currentWorksheet = workBook.Worksheets.First();
currentWorksheet.Cells["C2"].Value = 5;
currentWorksheet.Cells["C3"].Value = 7;
var c4 = Convert.ToDouble(currentWorksheet.Cells["C4"].Value); //c4 is zero. why?
}
.Formula
而不是.Value
吗?这可能会有所帮助。 - Graffl