Skip to content

Commit

Permalink
Merge pull request #273 from fabx2dan/master
Browse files Browse the repository at this point in the history
Fix for additional empty worksheet in Excel creation
  • Loading branch information
Baachi committed Jan 27, 2016
2 parents 762802f + d4b7246 commit 4e28115
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Writer/ExcelWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public function prepare()
$this->excel = $reader->load($this->filename);
} else {
$this->excel = new PHPExcel();
if(null !== $this->sheet && !$this->excel->sheetNameExists($this->sheet))
{
$this->excel->removeSheetByIndex(0);
}
}

if (null !== $this->sheet) {
Expand Down

0 comments on commit 4e28115

Please sign in to comment.