getActiveSheet()->fromArray(array_chunk($cases, 1), NULL, 'B2'); // set the right download headers header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="testcase-template.xls"'); header('Cache-Control: max-age=0'); PHPExcel_IOFactory::createWriter($excel, 'Excel5')->save('php://output');