Generate Multiple .xlsx Files

Topics: Developer Forum, User Forum
Oct 9, 2012 at 1:01 PM

I would like to know how I can generate multiple .xlsx files, all with the same structure but with different values in the cells. I have a local server running a local php website, I can only get it to download/generate one file and not multiple files. Does anyone have any ideas?

Coordinator
Oct 11, 2012 at 8:09 AM

Instantiate a PHPExcel object, populate cells, instantiate a writer, save;

detach cells and worksheets, and unset PHPExcel object

Instantiate a new PHPExcel object, populate cells, instantiate a writer, save;

repeat as needed

Oct 31, 2012 at 12:31 PM

How do I detach cells and worksheets?

Oct 31, 2012 at 12:43 PM

With this:

$objPHPExcel->disconnectWorksheets();
unset($objPHPExcel);
     

Please take note that only unsetting the object is not enough

Oct 31, 2012 at 12:55 PM

Ok thanks, I didn't realise that unsetting isn't enough. Thanks.