hellreaper
-
Posts
4 -
Joined
-
Last visited
Never
Posts posted by hellreaper
-
-
i really suck because i cant find were you found that info.....
-
Thank you for your reply,
I didn't find any information on how to read an existing excel file and writing in it with PHPExcel, I just found how to create a file here http://g-ernaelsten.developpez.com/tutoriels/excel2007/
-
Hello,
I have an template excel file and for each of my users in my data base i need to be able to create a different excel file. If anyone could guide be i would really appreciate it.
Thanks
How to write in an existing excel file?
in PHP Coding Help
Posted
Ok i found how to do it thank you!
include 'Classes/PHPExcel/IOFactory.php';
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
//we load the file that we want to read
$objPHPExcel = $objReader->load("test.xlsx");
//we change the file
$objPHPExcel->getActiveSheet()
->setCellValue('A1','EEEEEEEEE')
->setCellValue('A2','DDDDDDDDDDDD')
->setCellValue('A3','CCCCCCCCC')
->setCellValue('A4','BBBBBBBBBB')
->setCellValue('A5','AAAAAAAAAAAAA')
->setCellValue('A29','MaitrePylos');
//we create a new file
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
//we save
$objWriter->save('coco.xlsx');