Is there a way to write to a specific sheet in an excel multi-sheet file using PhpSpreadsheet without the sheets in said excel file being wiped out?
The write function in phpSpreadsheet always creates a new file thus wiping out my original file. Is this normal?
Below snippet always creates a new file:
$writer = PhpOfficePhpSpreadsheetIOFactory::createWriter($spreadsheet, "Xlsx");
$writer->save("mymultisheet-spreadsheet.xlsx");
Recognized by PHP Collective
New contributor
Klaus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2