{"record":{"id":"ffa6c62bd6c7ca19","repo":"PHPOffice/PhpSpreadsheet","slug":"not-a-cell-range-address-ffa6c6","errorCode":null,"errorMessage":"Not a cell range address","messagePattern":"Not a cell range address","errorType":"exception","errorClass":"PhpOffice\\PhpSpreadsheet\\Reader\\Exception","httpStatus":null,"severity":"error","filePath":"src/PhpSpreadsheet/Reader/Xls/Biff8.php","lineNumber":223,"sourceCode":"     * section 2.5.14.\n     */\n    protected static function readBIFF8CellRangeAddressFixed(string $subData): string\n    {\n        // offset: 0; size: 2; index to first row\n        $fr = self::getUInt2d($subData, 0) + 1;\n\n        // offset: 2; size: 2; index to last row\n        $lr = self::getUInt2d($subData, 2) + 1;\n\n        // offset: 4; size: 2; index to first column\n        $fc = self::getUInt2d($subData, 4);\n\n        // offset: 6; size: 2; index to last column\n        $lc = self::getUInt2d($subData, 6);\n\n        // check values\n        if ($fr > $lr || $fc > $lc) {\n            throw new ReaderException('Not a cell range address');\n        }\n\n        // column index to letter\n        $fc = Coordinate::stringFromColumnIndex($fc + 1);\n        $lc = Coordinate::stringFromColumnIndex($lc + 1);\n\n        if ($fr == $lr && $fc == $lc) {\n            return \"$fc$fr\";\n        }\n\n        return \"$fc$fr:$lc$lr\";\n    }\n\n    /**\n     * Reads a cell range address in BIFF8 e.g. 'A2:B6' or '$A$2:$B$6'\n     * there are flags indicating whether column/row index is relative\n     * section 3.3.4.\n     */","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/PHPOffice/PhpSpreadsheet/blob/65b080eef4d9fd11a5796135ab145883e5c3d6a6/src/PhpSpreadsheet/Reader/Xls/Biff8.php#L205-L241","documentation":"BIFF8 variant of the range sanity check: an 8-byte cell-range record with 2-byte row and column fields decoded with first row > last row or first column > last column. Since Excel stores ranges low-to-high, an inverted pair means misaligned or corrupt data rather than a legitimate range.","triggerScenarios":"Stream misalignment caused by an earlier mis-sized record, corrupt range records (dimensions, selection, merged cells, autofilter), or 0xFFFF deleted-reference markers landing in range fields.","commonSituations":"Damaged .xls uploads; files from unreliable exporters; workbooks whose records a prior tool rewrote incorrectly.","solutions":["Convert/re-save the workbook through Excel or LibreOffice to rebuild the records","Recover a clean copy from source (re-download, re-export) and confirm it opens in Excel","Load with setReadDataOnly(true) or restrict loaded sheets via setLoadSheetsOnly() to isolate the damaged sheet"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    $spreadsheet = IOFactory::load($path);\n} catch (\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e) {\n    if (str_contains($e->getMessage(), 'Not a cell range address')) {\n        // isolate sheets with setLoadSheetsOnly() or convert the file, then retry\n    }\n}","preventionTips":["Convert damaged .xls through LibreOffice/Excel before loading","Checksum uploaded files and compare with source to catch corruption early","Restrict loaded sheets to locate the corrupt one without losing the rest"],"tags":["xls","biff8","cell-range","phpspreadsheet"],"backgroundTag":"corrupt-biff-record","analyzedSha":"65b080eef4d9fd11a5796135ab145883e5c3d6a6","analyzedAt":"2026-08-17T05:40:41.646Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}