以下代码仅在我评论第三张表时才有效,我可以看到打开并查看插入的内容,但是当我包含第三张表时,它不会打开文件但显示错误,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);
请帮我解决这个问题。https://github.com/PHPOffice/PhpSpreadsheet/ (开发)分支