Erick Skrobot Erick Skrobot - 12 days ago 4
PHP Question

Clear spreadsheet using PHPExcel

How do I clear the sheet with PHPExcel? Something like Sheet.ClearContents in VBA.
All I could find was delete rows and columns and it's not useful for me as I need to clear entire sheet before writing data to the file.

Answer

You can remove the sheets and create a new one.

$myExcelObj->disconnectWorksheets();
$myExcelObj->createSheet();
Comments