title: PHPExcel Export for Larger Files fails
body: <p>I am using PHPExcel library to generate excel data based on mysql datbase. MySql query results in the 1,34,000 rows. And Excel Supports 65,536 Rows on one worksheet. So made logic like </p>
  
  <pre>
  foreach($result as $value)
  {
      $val = array_values($value);
  
      if($rowscounter &lt; 65000)
      {
          $objPHPExcel->addRow($val,$rowscounter);
      }
      else
      {
          $active_sheet++;
          $objPHPExcel->createSheet();
          $objPHPExcel->setActiveSheetIndex($active_sheet);
          $rowscounter = 1;
      }
      $rowscounter++;
  }
  // deliver header   
  header("Content-Type: $mtype; charset=" . $objPHPExcel->sEncoding);
  header("Content-Type:application/octet-stream");
  header("Content-Disposition: inline; filename=\"" . $filename . ".$ext\"");
  
  // Save it as an excel 2003 file
  $objWriter = IOFactory::createWriter($objPHPExcel,$objPHPExcel->sFileFormat);
  //echo "Peak memory usage: " . (memory_get_peak_usage(true) / 1024 / 1024) . " MB";exit;
  $objWriter->save('php://output');
  </pre>
  
  <p>to create new worksheet after 65000 records are reached for one woeksheet.</p>
  
  <p>But it doesn't work; not giving any output or error. Initially I thought its because of memory limit. But when echoed it shows peak memory to 1400.5 MB and I have set my memory limit up to 3500MB using <code>ini_set('memory_limit', '3500M');</code></p>
  
  <p>Could you please suggest something or any alternative?</p>