title: PHPExcel is not generating correct xls file
body: <p>I am using PHPExcel in my project to generate a xls file of data coming from the database. I have downloaded the library of PHPExcel and using it in my PHP class as give below :</p>
  
  <pre><code>Class name : A.class.php
  Path : inside a folder named "inc";
  PHPExcel Lib folder : inside "inc" and relative to A.class.php
  
  
  class A{
  
          // code stuff
  
          public function phpexcelgenerate()
          {
          require_once 'PHPExcel_1.7.9_doc/Classes/PHPExcel.php';
          header('Content-Type: application/vnd.ms-excel');
          header('Content-Disposition: attachment;filename="sam.xlsx"');
          header('Cache-Control: max-age=0');              
          $objPHPExcel = new PHPExcel;
          $objPHPExcel-&gt;setActiveSheetIndex(0);
          $objPHPExcel-&gt;getActiveSheet()-&gt;SetCellValue('A1', "12");
  
          $writer = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');  
          // This line will force the file to download    
          $writer-&gt;save();
          }
          // code stuff
          }
  </code></pre>
  
  <p>This code is generating a xls file but that file is fully empty. I am thinking that I have included the files of PHPExcel in a wrong way in PHP classes. Could anyone tell me where I am doing wrong OR an example how can I do the same ?</p>