You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The additional worksheet is created automatically in the construct of the PHPExcel class.
The issue can be solved editing the function 'prepare' in the ExcelWriter class.
public function prepare()
{
$reader = PHPExcel_IOFactory::createReader($this->type);
if ($reader->canRead($this->filename)) {
$this->excel = $reader->load($this->filename);
} else {
$this->excel = new PHPExcel();
/********* Fix start *********/
if(null !== $this->sheet && !$this->excel->sheetNameExists($this->sheet))
{
$this->excel->removeSheetByIndex(0);
}
/********* Fix end *********/
}
if (null !== $this->sheet) {
if (!$this->excel->sheetNameExists($this->sheet)) {
$this->excel->createSheet()->setTitle($this->sheet);
}
$this->excel->setActiveSheetIndexByName($this->sheet);
}
return $this;
}
Activity
fbdnl commentedon Oct 14, 2015
The additional worksheet is created automatically in the construct of the PHPExcel class.
The issue can be solved editing the function 'prepare' in the ExcelWriter class.
A pull request has been opened: #273