Erick Skrobot
Erick Skrobot

Reputation: 189

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.

Upvotes: 2

Views: 4501

Answers (2)

你波哥
你波哥

Reputation: 9

not a good way, you will erase the style . you should copy the style first!额

Upvotes: 0

RightClick
RightClick

Reputation: 1112

You can remove the sheets and create a new one.

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

Upvotes: 9

Related Questions