public string getCellStringNEW(int row, int column) { try { ICell cell = xlSheet.GetRow(row).Cells[column]; //Cell为非NUMERIC时,调用IsCellDateFormatted方法会报错,所以先要进行类型判断 if (cell.CellType == CellType.Numeric && DateUtil.IsCellDateFormatted(cell)) return cell.DateCellValue.ToString("yyyy/MM/dd"); else { return cell.StringCellValue; } } catch //(Exception ex) { try { return xlSheet.GetRow(row).Cells[column].NumericCellValue.ToString(); } catch { return ""; } //MessageBox.Show("错误:" + ex.Message); } }