problem for editing an Excel 2007 document

Topics: User Forum
Oct 9, 2013 at 3:56 AM
Hi everybody,

I have en excel 2007 document with 10 sheets but when I try to edit it with PHPExcel all the contents of those sheets (except the first one and the input made with PHPExcel) are erased.

Here is my code:
require 'PHPExcel.php';
require 'PHPExcel/IOFactory.php';
require 'PHPExcel/Writer/Excel2007.php';

$fileType = 'Excel2007';
$fileName = 'test.xlsx';

$objReader = PHPExcel_IOFactory::createReader($fileType);
$objPHPExcel = $objReader->load($fileName);

$activeSheet = $objPHPExcel->setActiveSheetIndexbyName('ID');
$activeSheet->setCellValue('A2', 'string test');

$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
$objWriter->save($fileName);
Can somebody help me please ?

Thank you very much
Coordinator
Oct 9, 2013 at 1:41 PM
It's unlikely to be possible to help without a sample file to test