{"record":{"id":"bafc68e1915b422a","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-value-of-cell-cell-getcolumnindex-cell","errorCode":null,"errorMessage":"Unable to get value of cell (\" + cell.getColumnIndex() + \", \" + cell.getRowIndex() + \")","messagePattern":"Unable to get value of cell \\(\" \\+ cell\\.getColumnIndex\\(\\) \\+ \", \" \\+ cell\\.getRowIndex\\(\\) \\+ \"\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/excelinput/poi/PoiCell.java","lineNumber":93,"sourceCode":"        case DATE:\n          // Timezone conversion needed since POI doesn't support this apparently\n          //\n          long time = cell.getDateCellValue().getTime();\n          long tzOffset = TimeZone.getDefault().getOffset( time );\n\n          return new Date( time + tzOffset );\n        case NUMBER_FORMULA:\n        case NUMBER:\n          return Double.valueOf( cell.getNumericCellValue() );\n        case STRING_FORMULA:\n        case LABEL:\n          return cell.getStringCellValue();\n        case EMPTY:\n        default:\n          return null;\n      }\n    } catch ( Exception e ) {\n      throw new RuntimeException( \"Unable to get value of cell (\"\n        + cell.getColumnIndex() + \", \" + cell.getRowIndex() + \")\", e );\n    }\n  }\n\n  public String getContents() {\n    try {\n      Object value = getValue();\n      if ( value == null ) {\n        return null;\n      }\n      return value.toString();\n    } catch ( Exception e ) {\n      throw new RuntimeException( \"Unable to get string content of cell (\"\n        + cell.getColumnIndex() + \", \" + cell.getRowIndex() + \")\", e );\n    }\n  }\n\n  public int getRow() {","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/excelinput/poi/PoiCell.java#L75-L111","documentation":"PoiCell.getValue() reads the typed value of an Apache POI cell and wraps any Exception in a RuntimeException naming the cell's column and row index. It is thrown when POI's typed accessors (getNumericCellValue, getStringCellValue, etc.) fail for the cell's underlying data — typically a formula evaluation error or a data-format problem.","triggerScenarios":"Calling value()/getValue() on a PoiCell when the switch on the cell's detected type dispatches to a POI getter that throws — e.g. a FORMULA cell whose evaluation fails, or type detection disagreeing with the stored cell type.","commonSituations":"Spreadsheets containing formulas requiring evaluation that POI cannot resolve; cells with unsupported or malformed types; files produced by tools that write inconsistent cell type metadata.","solutions":["Check e.getCause() to identify the failing POI operation and fix the cell at its root.","Re-open the source file in Excel/LibreOffice, re-save, and retry to normalize cell types.","If formulas are involved, ensure the workbook is loaded with formula evaluation enabled or pre-compute the values.","Upgrade the POI version bundled with Pentaho, as some type-handling bugs are POI-side."],"exampleFix":"// before\nObject v = cell.getValue(); // may throw\n// after\nObject v;\ntry { v = cell.getValue(); }\ncatch (RuntimeException e) {\n  log.logError(\"Cell \" + cell.getColumn() + \",\" + cell.getRow() + \" unreadable: \" + e.getMessage());\n  v = null;\n}","handlingStrategy":"try-catch","validationCode":"Object v = null; try { v = cell.getValue(); } catch (RuntimeException ignored) {} // probe readability before use","typeGuard":"boolean hasValue(KCell c) { try { return c.getValue() != null; } catch (RuntimeException e) { return false; } }","tryCatchPattern":"try { Object v = cell.getValue(); } catch (RuntimeException e) { handleUnreadableCell(cell.getColumn(), cell.getRow(), e.getCause()); }","preventionTips":["Pre-compute or strip formulas in source files","Re-save workbooks in Excel/LibreOffice to normalize cell types","Check the cause chain for POI-specific errors","Keep the bundled POI version up to date"],"tags":["poi","spreadsheet","cell-read","runtime-exception"],"backgroundTag":"file-read-failed","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}