notices with addsheet() creating new file

Jan 31, 2011 at 9:57 AM


I am trying to make a new xlsx file containing all sheets from different xlsx files by using  the function addsheet.  The names of the files are in a array : $namesheet. The files contain only one sheet.

The code works but I lose the format and I have some notices :

Notice: Undefined offset: 3 in C:           \Classes\PHPExcel.php on line 729
Notice: Undefined offset: 1 in C:           \Classes\PHPExcel.php on line 774


code :

foreach ($namesheet as $contenu)
            $objReader= PHPExcel_IOFactory::createReader('Excel2007');
            $objReader->setReadFilter( new MyReadFilter() );
                $objPHPExcel[$k] = $objReader->load($fichier);
            } catch(Exception $e) {
                die('Erreur chargement du fichier : '.$fichier);
        $writer = new PHPExcel();
        for($kk=0;$kk<$k ;$kk++)
        $save = PHPExcel_IOFactory::createWriter($writer,'Excel2007');


Thank you for your help

Jan 31, 2011 at 11:37 AM


I fixe the problem using addExernalSheet :


Sorry for your time