{"record":{"id":"daae4690de420c49","repo":"PHPOffice/PhpSpreadsheet","slug":"row-number-must-be-a-positive-integer","errorCode":null,"errorMessage":"Row number must be a positive integer","messagePattern":"Row number must be a positive integer","errorType":"exception","errorClass":"PhpOffice\\PhpSpreadsheet\\Exception","httpStatus":null,"severity":"error","filePath":"src/PhpSpreadsheet/Collection/Cells.php","lineNumber":275,"sourceCode":"    }\n\n    /**\n     * Get highest worksheet column.\n     *\n     * @param null|int|string $row Return the highest column for the specified row,\n     *                    or the highest column of any row if no row number is passed\n     *\n     * @return string Highest column name\n     */\n    public function getHighestColumn($row = null): string\n    {\n        if ($row === null) {\n            return $this->getHighestRowAndColumn()['column'];\n        }\n\n        $row = (int) $row;\n        if ($row <= 0) {\n            throw new PhpSpreadsheetException('Row number must be a positive integer');\n        }\n\n        $maxColumn = 1;\n        $toRow = $row * AddressRange::MAX_COLUMN_INT;\n        $fromRow = --$row * AddressRange::MAX_COLUMN_INT;\n        foreach ($this->index as $coordinate) {\n            if ($coordinate < $fromRow || $coordinate >= $toRow) {\n                continue;\n            }\n            $column = ($coordinate % AddressRange::MAX_COLUMN_INT) ?: AddressRange::MAX_COLUMN_INT;\n            $maxColumn = max($column, $maxColumn);\n        }\n\n        return Coordinate::stringFromColumnIndex($maxColumn);\n    }\n\n    /**\n     * Get highest worksheet row.","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/PHPOffice/PhpSpreadsheet/blob/65b080eef4d9fd11a5796135ab145883e5c3d6a6/src/PhpSpreadsheet/Collection/Cells.php#L257-L293","documentation":"Error \"Row number must be a positive integer\" thrown in PHPOffice/PhpSpreadsheet.","triggerScenarios":"Thrown at src/PhpSpreadsheet/Collection/Cells.php:275 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"65b080eef4d9fd11a5796135ab145883e5c3d6a6","analyzedAt":"2026-08-17T05:40:41.646Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}