I am trying to generate Excel file with multiple worksheets in it, and the file is generating with proper data, but giving error while opening it.
error is as:
Also, when I am trying to iterate over sheets through loop, I unable to access sheets except sheet one.
PHP error occured: You tried to set a sheet active by the out of bounds index: 1. The actual number of sheets is 1.
Does that means the others sheets are not inserted while creating file.
use ob_clean() before, php://output as (CORRECT):
ob_clean();
$objWriter->save('php://output');
You may using like (WRONG):
$objWriter->save('php://output');
ob_clean();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With