'How to create multiple sheet in Excel File PHP

I am trying to add two sheets in Excel file using my php code. Here is the code

$objPHPExcel->setActiveSheetIndex(0);
$objPHPExcel= $objReader->load(SS_ADMIN_PATH . "import_export/export_debit_note.php");
$spreadsheet->createSheet();
$spreadsheet->setActiveSheetIndex(1);
$objPHPExcel= $objReader->load(SS_ADMIN_PATH . "import_export/export_debit_note_detail.php");

The code is working fine and exporting Excel file but with one sheet but I want it to create another sheet and place export_debit_note_detail.php file content in that sheet.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source