I have been using PhpSpreadsheet for the first time and always worked great. However today I needed to make one file where the template copies over several sheets (over 300 sheets). Looked the documentation and it uses the clone method. However, when executed, the code won't give and error or exception. Just keeps "waiting for localhost" and suddenly stops. I have increased the set_time_limit and even the memory limit, but still it refueses to work.
CODE
$File= IOFactory::createReader("Xlsx"); $Excel = $File->load('original.xlsx'); $clonedSheet = clone $Excel->getActiveSheet(); for($i = 0; $i <= 10; $i++) { $clonedSheet->setTitle('Simple Clone'.$i); $Excel->addSheet($clonedSheet); } $writer = IOFactory::createWriter($Excel, "Xlsx"); $filename = "omitidos.xlsx"; $writer->save("output/".$filename );
I try'd taking the for loop and even without it it does the same.
Could it be some issue with PHP7?
Any help will be welcome.