create Excelfile and open, but not save

Topics: Developer Forum, Project Management Forum, User Forum
Sep 25, 2013 at 10:26 AM

how can create a excelfile and open with phpexcel, but not save?
Also with save(), i can save on server, but i will open the file and then over excel save or not.

Thanks for your answer.
Sep 25, 2013 at 1:46 PM
-The workbook is not automatically saved, so if you don't take a provision to back it up, it won't.
-A workbook can be saved on the server or 'push' directly to the user's browser.
-You can not open a workbook with Excel from the memory of the server.
Sep 25, 2013 at 2:13 PM
Edited Sep 25, 2013 at 2:14 PM
Ok, thanks.

Also the file is automatically saved with:
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save($pfad . $file);
But how is not automatically saved?
It would be good if the Excel file just opens.

Sep 25, 2013 at 4:45 PM
If you must add two lines so that the workbook is saved, I do not call it "automatically" :-)
But if you prefer: to ensure that the workbook is not saved, do not create writer and do not call to the save method.
But the cases where you created a workbook, add data, and then you give up all are rare

"It would be good if the Excel file just opens."

It takes just one click to open it by default (what the user can change).
Server-side, you don't need to save the file to disk: the call to the save method with the parameter php://output sending directly to the browser.