-
Couldn't load subscription status.
- Fork 3.6k
Description
This is:
- [x] a bug report
What is the expected behavior?
The xls success output
What is the current behavior?
PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort(): Argument #1 ($textValue) must be of type string, null given, called in /vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Workbook.php on line 482
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
<?php
require __DIR__ . '/vendor/autoload.php';
// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
// add code that show the issue here...
$sheetname = ""; //pass in blank as sheetname cause the issue
$table1worksheet = new \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet($spreadsheet,$sheetname);
$spreadsheet->addSheet($table1worksheet,0);
$sheetIndex = $spreadsheet->getIndex($spreadsheet->getSheetByName('Worksheet'));
$spreadsheet->removeSheetByIndex($sheetIndex);
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xls($spreadsheet,'XLS');
$writer->save("php://output");exit();If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.
What features do you think are causing the issue
- Reader
- Writer
- Styles
- Data Validations
- Formula Calculations
- Charts
- AutoFilter
- Form Elements
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Haven't tested, but confirmed that xls are affected.
Which versions of PhpSpreadsheet and PHP are affected?
"phpoffice/phpspreadsheet": "^1.18",php8.1