[Solved] PhpSpreadsheet Error: Invalid cell coordinate [1

When TP5 uses phpspreadsheet, if the number of columns exceeds 26, it will report an error. The specific solutions are as follows: it is easy to use by personal test

//Write to the table header section to read
  // Set the table header
  // $head formatted as ['Name', 'Phone', 'Contact']
        $colum = 'A';
        foreach ($head as $v) {
            $sheet->setCellValue($colum . '1', $v);
            $sheet->getColumnDimension($colum)->setWidth(20);
            $colum++;
        }
        //Write content to read
          $column = 2;
        foreach ($data as $key => $rows) {
            $span = 'A';
            // Column Write
            foreach ($rows as $keyName => $value) {
                $sheet->setCellValue($span . $column, $value);
                $span++;
            }
            $column++;
        }

Read More: