using (FileStream fs = File.OpenRead(fileName))
{
IWorkbook IWb = WorkbookFactory.Create(fs);
ISheet ISheet = IWb.GetSheetAt(0);
IFormulaEvaluator fe = WorkbookFactory.CreateFormulaEvaluator(IWb);
ICell IFe = fe.EvaluateInCell(ICell);
for (int i = 0; i <= ISheet.LastRowNum; i++)
{
IRow IRow = ISheet.GetRow(i);
for (int j = 0; j < IRow.Cells.Count; j++)
{
ICell ICell = IRow.GetCell(j);
if (ICell.CellType == CellType.FORMULA)
{
这个地方怎么去ICell的值,这个值的类型是什么?
}
}
}
}
这种类型是字符串类型,取值时直接ICell.StringValue的属性,转换成数值类型。
cell.CellFormula;