ExcelSheet = ExcelBook.getSheet(SheetName);
Cell = ExcelSheet.getRow(RowNum).getCell(ColNum);
String cellData = Cell.getStringCellValue();
報非法參數錯誤。
String無法獲取一個數值類型
修改代碼
String cellData = null;
ExcelSheet = ExcelBook.getSheet(SheetName);
Cell = ExcelSheet.getRow(RowNum).getCell(ColNum);
if (Cell != null) {
Cell.setCellType(Cell.CELL_TYPE_STRING);
cellData = Cell.getStringCellValue();
}
即可。