"Worksheet" not desiderated

Topics: User Forum
May 29, 2014 at 10:12 AM
When I create my file with some sheets ("inverter n°"), I found also an empty "Worksheet" sheet. How to eliminate it?

My code:
for ($i = 1; $i <= 4; ++$i) { // to create 4 files
    $objPHPExcel = new PHPExcel();  
for ($n = 1; $n <= 10; ++$n) { // to create 10 sheets for each files

    $objPHPExcel -> createSheet();
        $objPHPExcel -> setActiveSheetIndex($n);
    $objPHPExcel -> getActiveSheet() -> setTitle('Inverter '.$n);
    $objPHPExcel -> getActiveSheet() -> fromArray($impianti[$imp]["inverter".$n]);

}

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter -> save($output.".xlsx");    
}