I can't export any excel files, but it returns me a bunch of garbled.I just export an empty excel file.
$PHPExcel = new \PHPExcel();
$fileName='test';
$PHPWriter = \PHPExcel_IOFactory::createWriter($PHPExcel,'Excel2007');
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Type: application/cha');
header("Content-Disposition: attachment;filename=$fileName".".xlsx");
header('Cache-Control: max-age=0');
$PHPWriter->save("php://output");