switch (cell.CellType) { case CellType.BLANK: //空数据类型处理 dr[iRow] = ""; break; case CellType.STRING: //字符串类型 dr[iRow] = cell.StringCellValue; break; case CellType.NUMERIC: //数字类型 if (DateUtil.IsValidExcelDate(cell.NumericCellValue)) { dr[iRow] = cell.DateCellValue; } else { dr[iRow] = cell.NumericCellValue; } break; case CellType.FORMULA: HSSFFormulaEvaluator e = new HSSFFormulaEvaluator(hssfworkbook); dr[iRow] = e.Evaluate(cell).StringValue; break; default: dr[iRow] = ""; break; }