title: setActiveSheetIndex not working properly
body: <p>I'm using PHPExcel to make export xls with 2 worksheets. When I open the generated xls file, it opens directly to the second worksheet, even though I've declared in the code that generates the first worksheet:</p>
  
  <pre><code>$objPHPExcel-&gt;setActiveSheetIndex(0) 
  </code></pre>
  
  <p>This happened after I'd added the following lines in the code that generates the second worksheet.</p>
  
  <pre><code>$objPHPExcel-&gt;getSheet(1)-&gt;getStyle('A1:E1')-&gt;getFont()-&gt;setBold(true);
  
      $objPHPExcel-&gt;getSheet(1)-&gt;getColumnDimension('A')-&gt;setWidth(15);
      $objPHPExcel-&gt;getSheet(1)-&gt;getRowDimension(1)-&gt;setRowHeight(40);
      $objPHPExcel-&gt;getSheet(1)-&gt;getStyle('A:F')-&gt;getAlignment()-&gt;setWrapText(true); 
      $objPHPExcel-&gt;getSheet(1)-&gt;getColumnDimension('B')-&gt;setWidth(40);
      $objPHPExcel-&gt;getSheet(1)-&gt;getStyle('B')-&gt;getAlignment()-&gt;setWrapText(true); 
      $objPHPExcel-&gt;getSheet(1)-&gt;getColumnDimension('C')-&gt;setWidth(15);
      $objPHPExcel-&gt;getSheet(1)-&gt;getColumnDimension('D')-&gt;setWidth(15);
      $objPHPExcel-&gt;getSheet(1)-&gt;getColumnDimension('E')-&gt;setWidth(15);
      $objPHPExcel-&gt;getSheet(1)-&gt;getColumnDimension('E')-&gt;setAutoSize(true);
  
      $objPHPExcel-&gt;getSheet(1)-&gt;getPageMargins(1)-&gt;setTop(1);
      $objPHPExcel-&gt;getSheet(1)-&gt;getPageMargins(1)-&gt;setRight(0.75);
      $objPHPExcel-&gt;getSheet(1)-&gt;getPageMargins(1)-&gt;setLeft(0.75);
      $objPHPExcel-&gt;getSheet(1)-&gt;getPageMargins(1)-&gt;setBottom(1);
  
      $objPHPExcel-&gt;getSheet(1)-&gt;getStyle('A1:E1')-&gt;getFill()
                      -&gt;setFillType(PHPExcel_Style_Fill::FILL_SOLID)
                      -&gt;getStartColor()-&gt;setRGB('4EE900');
  </code></pre>
  
  <p>If I comment some of the code lines, (as shown in the picture) the active sheet index works fine.</p>
  
  <p><img src="https://i.stack.imgur.com/gKPui.png" alt="enter image description here"></p>
  
  <p>So, if I remove these lines, it works fine. Any Idea how to fix this to keep first worksheet as the active worksheet?</p>