diff --git a/src/PhpSpreadsheet/Worksheet/Worksheet.php b/src/PhpSpreadsheet/Worksheet/Worksheet.php index 0baf6ecd..cb2cd06d 100644 --- a/src/PhpSpreadsheet/Worksheet/Worksheet.php +++ b/src/PhpSpreadsheet/Worksheet/Worksheet.php @@ -1336,12 +1336,12 @@ class Worksheet implements IComparable */ public function createNewCell($coordinate) { + [$column, $row] = Coordinate::coordinateFromString($coordinate); $cell = new Cell(null, DataType::TYPE_NULL, $this); $this->cellCollection->add($coordinate, $cell); $this->cellCollectionIsSorted = false; // Coordinates - [$column, $row] = Coordinate::coordinateFromString($coordinate); $aIndexes = Coordinate::indexesFromString($coordinate); if ($this->cachedHighestColumn < $aIndexes[0]) { $this->cachedHighestColumn = $aIndexes[0]; diff --git a/tests/PhpSpreadsheetTests/Worksheet/WorksheetNamedRangesTest.php b/tests/PhpSpreadsheetTests/Worksheet/WorksheetNamedRangesTest.php index 4eddb26e..b367583b 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/WorksheetNamedRangesTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/WorksheetNamedRangesTest.php @@ -72,7 +72,7 @@ class WorksheetNamedRangesTest extends TestCase $namedCell = 'GOODBYE'; $this->expectException(Exception::class); -// $this->expectExceptionMessage("Invalid cell coordinate {$namedCell}"); + $this->expectExceptionMessage("Invalid cell coordinate {$namedCell}"); $worksheet = $this->spreadsheet->getActiveSheet(); $worksheet->getCell($namedCell); @@ -84,7 +84,7 @@ class WorksheetNamedRangesTest extends TestCase $ucNamedCell = strtoupper($namedCell); $this->expectException(Exception::class); -// $this->expectExceptionMessage("Invalid cell coordinate {$ucNamedCell}"); + $this->expectExceptionMessage("Invalid cell coordinate {$ucNamedCell}"); $worksheet = $this->spreadsheet->getActiveSheet(); $worksheet->getCell($namedCell);