new with phpExcel

Topics: User Forum
May 21, 2012 at 10:35 AM
Edited May 21, 2012 at 10:36 AM

Hi everyone, I'm just getting started with this, and I manage myself to do a simple Excel sheet with variable data. That's good, but, is there a way to Open the file with Excel automatically after saving it?

May 25, 2012 at 2:53 AM


If i understand your question properly you want the standard pop up to save or open a file?


To do so you simply need to add headers to the top of your export to excel php file


header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename=excelfile.xlsx');
header('Cache-Control: max-age=0');


At the bottom of your script you replace

$objWriter->save("05featuredemo.pdf"); type command


If you no longer desire a copy to be saved to the server.