title: phpexcel - using it with excel template (chart goes missing) php
body: <p>I have tried to use <strong>phpexcel</strong> with my own template file. phpexcel loads the file and writes data to some cells A2, A3, A4 for example.. and opens an output file with the new data.</p>
  
  <p>my template file has chart built-in.. all i want to phpexcel to do is to populate values in cells and don't touch the chart. And, open the new file. <strong>(Please note that I don't want to make the chart in code.. I want the chart to pre-exist with in my template in same format as I created originally). Only the data should update.</strong></p>
  
  <p>But, when i try to do this.. the chart itself goes missing from the resulting file. After trying various ways.. still failed.</p>
  
  <p>And, i found the following code from <a href="http://phpexcel.codeplex.com/discussions/397263" rel="nofollow">http://phpexcel.codeplex.com/discussions/397263</a></p>
  
  <pre><code>require_once 'Classes/PHPExcel.php'; 
  /** PHPExcel_IOFactory */
  include 'Classes/PHPExcel/IOFactory.php';
  
  
  
  
  $target ='Results/';
  $fileType = 'Excel2007';   
  $InputFileName = $target.'Result.xlsx';   
  $OutputFileName =  $target . '_Result.xlsx';
  
   //Read the file (including chart template) 
  $objReader = PHPExcel_IOFactory::createReader($fileType); 
  $objReader-&gt;setIncludeCharts(TRUE);
  $objPHPExcel = $objReader-&gt;load($InputFileName); 
  
   //Change the file 
  
  
  $objPHPExcel-&gt;setActiveSheetIndex(0)
  // Add data
              -&gt;setCellValue('C3','10' )
              -&gt;setCellValue('C4','20' )
              -&gt;setCellValue('C5','30')
              -&gt;setCellValue('C5','40' );
  
   //Write the file (including chart)
  
  PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);
  $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $fileType); 
  $objWriter-&gt;setIncludeCharts(TRUE);
  $objWriter-&gt;save($OutputFileName);
  </code></pre>
  
  <p>The above code works in excel 2010 and now keeps my chart in tact... but still when I try to use filetype "Excel5" it doesn't work.</p>
  
  <p>It throws the following error:</p>
  
  <pre><code>    Fatal error: Call to undefined method PHPExcel_Reader_Excel5::setIncludeCharts()
   in D:\IT\bfstools\PHPExcel\MyExamples\test1.php on line 16
  </code></pre>
  
  <p><strong>Please provide a simple solution where I want my template file to work with .xls and .xlsx and all my original chart in the template file should stay intact</strong>. I do not want the chart removed it from the resulting file. Neither do I plan to create the chart using phpexcel code. (why write unnecessary code when excel can do all the work for you).</p>
  
  <p>I want the easiest way out which is just to use everything with in my template and just populate cells with new data. And, my existing chart in the template comes live automatically. I don't want to write unnecessary code while I can safely rely on excel template and charting functions.</p>
  
  <p>Please help.</p>