public static String GetCellData(this ISheet sheet, Int32 x, Int32 y) { String value = null; var cell = OfficeAssistor.GetCell(sheet, x, y); if (cell != null) { value = cell.ToString(); } return(value); }
public static Double?GetCellDataDouble(this ISheet sheet, Int32 x, Int32 y) { Double?value = null; ICell cell = OfficeAssistor.GetCell(sheet, x, y); if (cell != null) { if (cell.CellType == CellType.String) { String valueStr = cell.ToString(); if (Double.TryParse(valueStr, out Double doubleValue)) { value = doubleValue; } } else { value = cell.NumericCellValue; } } return(value); }