- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3.6k
Description
Hello,
This is:
a bug report
What is the expected behavior?
I am using PhpSpreadsheet 1.18.0
I need to read a xlsx file and add some information and then write it
What is the current behavior?
PhpOffice\PhpSpreadsheet\Exception
In file: PhpSpreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php
line: 39
message: Cell coordinate can not be zero-length string
Trace:
#0 PhpSpreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php(124): PhpOffice\PhpSpreadsheet\Cell\Coordinate::coordinateFromString('')
#1 PhpSpreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php(101): PhpOffice\PhpSpreadsheet\Cell\Coordinate::absoluteCoordinate('')
#2 PhpSpreadsheet/src/PhpSpreadsheet/Writer/Xlsx/DefinedNames.php(169): PhpOffice\PhpSpreadsheet\Cell\Coordinate::absoluteReference('')
#3 PhpSpreadsheet/src/PhpSpreadsheet/Writer/Xlsx/DefinedNames.php(45): PhpOffice\PhpSpreadsheet\Writer\Xlsx\DefinedNames->writeNamedRangeForPrintArea(Object(PhpOffice\PhpSpreadsheet\Worksheet\Worksheet), 1)
#4 PhpSpreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php(56): PhpOffice\PhpSpreadsheet\Writer\Xlsx\DefinedNames->write()
#5 PhpSpreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php(372): PhpOffice\PhpSpreadsheet\Writer\Xlsx\Workbook->writeWorkbook(Object(PhpOffice\PhpSpreadsheet\Spreadsheet), true)
#6 example.php(12): PhpOffice\PhpSpreadsheet\Writer\Xlsx->save('/tmp/test_out.xlsx')
What are the steps to reproduce?
<?php
require __DIR__ . '/vendor/autoload.php';
$file_in='/tmp/test_in.xlsx';
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
$spreadsheet = $reader->load($file_in);
//call xlsx writer without any modification
$file_out='/tmp/test_out.xlsx';
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($spreadsheet);
$writer->save($file_out);Which versions of PhpSpreadsheet and PHP are affected?
php 7.4 and PhpSpreadsheet 1.18.0
I would prefer to send test_in.xlsx file privately