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);