title: PHPexcel CSV master file
body: <p>I would like to have multiple csv's and add them in a master csv file. It when I add an extra csv file in the array it throws a exception error.</p>
  
  <p><code>Uncaught exception 'Exception' with message 'Workbook already contains a worksheet named 'Worksheet'. Rename the external sheet first.' in</code>
  <br>
  Please find below my code<br></p>
  
  <pre><code>include'../Classes/PHPExcel.php';
  include'../Classes/PHPExcel/IOFactory.php';
  
  $filenames = array('Sheet1.csv','Sheet2.csv');
  
  $bigExcel = new PHPExcel();
  $bigExcel-&gt;removeSheetByIndex(0);
  
  $reader = new PHPExcel_Reader_CSV();
  
  foreach ($filenames as $filename) {
  $excel = $reader-&gt;load($filename);
  foreach ($excel-&gt;getAllSheets() as $sheet) {
      $bigExcel-&gt;addExternalSheet($sheet);
  }
  foreach ($excel-&gt;getNamedRanges() as $namedRange) {
      $bigExcel-&gt;addNamedRange($namedRange);
  }
  }
  $writer = new PHPExcel_Writer_CSV($bigExcel);
  $writer-&gt;save('2007-write.csv');
  </code></pre>