title: Combine two or more xls files as worksheets PHPExcel
body: <p>I've been looking everywhere on how to do this with two existing files, looks like all documentation is on creating new files. I'd like to take one of the files and add the second file to it as a new worksheet then save it to the server.
  I've been trying with no avail like this:</p>
  
  <pre><code>$file="test.xls";
  $file2="test2.xls";
  $outputFile = "final.xls";
  $phpExcel = new PHPExcel($file);
  $phpExcel-&gt;getActiveSheet();
  $phpExcel-&gt;setActiveSheetIndex(0);
  $phpExcel-&gt;addSheet($file2);
  header("Content-Type: application/vnd.ms-excel");
  header("Content-Disposition: attachment; filename=$outputFile");
  header("Cache-Control: max-age=0");
  $objWriter = PHPExcel_IOFactory::createWriter($phpExcel, "Excel5");
  file_put_contents($outputFile, $objWriter);
  </code></pre>
  
  <p>Any help would be greatly appreciated. Very new to PHP. </p>