Simple Update XLS (Read > Modify > Save .xls)

Topics: Developer Forum
Nov 27, 2009 at 5:03 PM


First off, sorry if this has been asked before or mentioned elsewhere, I have tried my best to find a simple solution on my own with little to no luck.  I would like to (in my PHP script) open an .xls file from the server, update the contents (adding values to pre-existing values) and then save it to the server.  Basically, I would have a xls template with some minor formatting and basic addition formulas.  The xls would be an order form, so I would like to be able to add numerical values to the pre-existing values, have the totals update, then save it to the server.  Is there an example you could point me towards?  There may be something simple that I have just mistakenly overlooked.

Thank you for your time.

Jan 22, 2010 at 7:20 AM

Here is an example:

$objPHPexcel = PHPExcel_IOFactory::load('template.xlsx');

$objWorksheet = $objPHPexcel->getActiveSheet();

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

I have updated the "PHPExcel developer documentation" and included a section with this example.

Jan 24, 2010 at 8:30 PM

Thank you, I really appreciate it!

Apr 8, 2010 at 1:51 PM

I have a problem: I have a xls template with charts .

I used KOYAMA script for update, but when  save , file dimension become lower and chart are delete but Data no. Why?

thank you!

Apr 20, 2010 at 5:01 AM

@the_driver: Sorry, but charts are not yet supported.

Jul 14, 2010 at 8:46 AM

So are charts supported yet ?

I really really would like charts to be included.

Even only when available by using templates.

Thanxs !