The following code is working only when I comment the Thrid sheet, I can see open and view the content which inserted, but when I include the Third sheet, it doesn't open the file but showing error,can’t be opened for some reason.
.
$this->spreadsheet = new Spreadsheet;
$this->spreadsheet->setActiveSheetIndex(0);
$sheet = $this->spreadsheet->getActiveSheet();
$sheet->setCellValue('A1', 'Hello world');
$sheet->setTitle('First');
$this->spreadsheet->createSheet();
$this->spreadsheet->setActiveSheetIndex(1);
$sheet = $this->spreadsheet->getActiveSheet();
$sheet->setCellValue('A1', 'Hello');
$sheet->setTitle('Second');
$this->spreadsheet->createSheet();
$this->spreadsheet->setActiveSheetIndex(2);
$sheet = $this->spreadsheet->getActiveSheet();
$sheet->setTitle('Third');
$writer = new Xlsx($this->spreadsheet);
$writer->setOffice2003Compatibility(true);
$writer->save($fileName);
Please help me to solve this. https://github.com/PHPOffice/PhpSpreadsheet/ (develop) branch