Append data to existing file PHPExcel

Hi,

Creating a new export file with PhpExcel library seems very easy, but when I try to open an existing excel file and write in that file I have problems, can anyone help me on this matter?




$xls = PHPExcel_IOFactory::load($download.'/'.$this->getFileName());

....

//add data to the file

....

$objWriter = PHPExcel_IOFactory::createWriter($xls, 'Excel5');

$objWriter->save($download.'/'.$this->getFileName());



The error that I receive is an exception that is raised I suppose but I can not get the whole error to be displayed because of the unregister command that we need to call before initializing a PHPExcel object.

Therefore the error that I get is CExpection class is not found, but due to debugging I found out that the problem comes from this line:

$objWriter->save($download.’/’.$this->getFileName());

Thank you in advance for your help.

Boglarka

Maybe the problem have to see with the var $download or the method $this->getFileName()

I recomend u use




      echo CVarDumper::dump($this->getFileName,10,true);



To try if u var or method have the correct values for the factory method.

XD hey remeber that this forum is spanish, unless u post must be on the languajes hahaha

Regards

Hi,

Thank you for the reply, yes I have checked and the path is the correct one.

Any other ideas?

Regards,

Boglarka

Can u send me a link with the library to test it?