title: PHPExcel not setting row height based on content
body: <p>I've been trying to set the height of excel rows to auto, based on the content of some long, wrapped cells without carriage returns.</p>
  
  <p>I tried the approachs mentioned in the answers to several older questions, but none of the approachs do the job.  I couldn't figure out why.</p>
  
  <p>The following is the code I have.  I kept all of it in order to find any height reset that I could be inadvertently doing.</p>
  
  <pre><code>$objReader = new PHPExcel_Reader_CSV();
  $objPHPExcel = $objReader-&gt;load("data.csv");
  $sheet = $objPHPExcel-&gt;getActiveSheet();
  //$sheet-&gt;getDefaultRowDimension()-&gt;setRowHeight(-1);
  $sheet-&gt;getDefaultStyle()-&gt;getAlignment()-&gt;setWrapText(true);
  $sheet-&gt;getColumnDimension('A')-&gt;setWidth(14);
  $sheet-&gt;getColumnDimension('B')-&gt;setWidth(50);
  $sheet-&gt;getColumnDimension('C')-&gt;setWidth(14);
  $sheet-&gt;getColumnDimension('D')-&gt;setWidth(14);
  $sheet-&gt;getColumnDimension('E')-&gt;setWidth(30);
  $sheet-&gt;getColumnDimension('F')-&gt;setWidth(30);
  $sheet-&gt;getColumnDimension('G')-&gt;setWidth(5);
  $sheet-&gt;getColumnDimension('H')-&gt;setWidth(5);
  $sheet-&gt;getColumnDimension('I')-&gt;setWidth(5);
  $sheet-&gt;getColumnDimension('J')-&gt;setWidth(5);
  $sheet-&gt;getColumnDimension('K')-&gt;setWidth(5);
  $sheet-&gt;getColumnDimension('L')-&gt;setWidth(5);
  $sheet-&gt;getColumnDimension('M')-&gt;setWidth(30);
  $sheet-&gt;getColumnDimension('N')-&gt;setWidth(14);
  $sheet-&gt;getColumnDimension('O')-&gt;setWidth(14);
  $sheet-&gt;getColumnDimension('P')-&gt;setWidth(14);
  $sheet-&gt;getColumnDimension('Q')-&gt;setWidth(14);
  $sheet-&gt;getColumnDimension('R')-&gt;setWidth(14);
  $sheet-&gt;getColumnDimension('S')-&gt;setWidth(14);
  $sheet-&gt;getColumnDimension('T')-&gt;setWidth(14);
  $sheet-&gt;getColumnDimension('U')-&gt;setWidth(14);
  $sheet-&gt;getColumnDimension('V')-&gt;setWidth(50);
  $sheet-&gt;getColumnDimension('W')-&gt;setWidth(30);
  $sheet-&gt;getColumnDimension('X')-&gt;setWidth(30);
  $sheet-&gt;getColumnDimension('Y')-&gt;setWidth(30);
  $sheet-&gt;getColumnDimension('Z')-&gt;setWidth(30);
  $sheet-&gt;getColumnDimension('AA')-&gt;setWidth(30);
  $sheetstyle = $sheet-&gt;getStyle('a1:aa'.$sheet-&gt;getHighestRow());
  $sheetstyle-&gt;getAlignment()-&gt;setWrapText(true);
  $sheetstyle-&gt;getAlignment()-&gt;setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
  $sheetstyle-&gt;getFont()-&gt;setSize(10);
  //$sheet-&gt;getRowDimension()-&gt;setRowHeight(-1);
  
  $sharedStyle1 = new PHPExcel_Style();
  $sharedStyle2 = new PHPExcel_Style();
  $sharedStyle3 = new PHPExcel_Style();
  
  $sharedStyle1-&gt;applyFromArray(
    array('fill'  =&gt; array(
      'type'      =&gt; PHPExcel_Style_Fill::FILL_SOLID,
      'color'     =&gt; array('argb' =&gt; 'FFCCFFCC')
    ),
    'borders' =&gt; array(
      'bottom'    =&gt; array('style' =&gt; PHPExcel_Style_Border::BORDER_NONE),
      'right'     =&gt; array('style' =&gt; PHPExcel_Style_Border::BORDER_NONE),
      'top'     =&gt; array('style' =&gt; PHPExcel_Style_Border::BORDER_NONE),
      'left'    =&gt; array('style' =&gt; PHPExcel_Style_Border::BORDER_NONE)
    )
  ));
  
  $sharedStyle2-&gt;applyFromArray(
    array('fill'  =&gt; array(
      'type'      =&gt; PHPExcel_Style_Fill::FILL_SOLID,
      'color'     =&gt; array('argb' =&gt; 'FFFFFF00')
    ),
    'borders' =&gt; array(
      'bottom'    =&gt; array('style' =&gt; PHPExcel_Style_Border::BORDER_NONE),
      'right'     =&gt; array('style' =&gt; PHPExcel_Style_Border::BORDER_NONE),
      'top'     =&gt; array('style' =&gt; PHPExcel_Style_Border::BORDER_NONE),
      'left'    =&gt; array('style' =&gt; PHPExcel_Style_Border::BORDER_NONE)
    )
  ));
  $sharedStyle3-&gt;applyFromArray(
    array('fill'  =&gt; array(
      'type'      =&gt; PHPExcel_Style_Fill::FILL_SOLID,
      'color'     =&gt; array('argb' =&gt; 'EEEEEEEE')
    ),
    'borders' =&gt; array(
      'bottom'    =&gt; array('style' =&gt; PHPExcel_Style_Border::BORDER_NONE),
      'right'     =&gt; array('style' =&gt; PHPExcel_Style_Border::BORDER_NONE),
      'top'     =&gt; array('style' =&gt; PHPExcel_Style_Border::BORDER_NONE),
      'left'    =&gt; array('style' =&gt; PHPExcel_Style_Border::BORDER_NONE)
    )
  ));
  $objPHPExcel-&gt;getActiveSheet()-&gt;setSharedStyle($sharedStyle1, "A1:AA1");
  
  for($xxx = 1; $xxx &lt;= $sheet-&gt;getHighestRow(); $xxx++){
    $sheet-&gt;getRowDimension($xxx)-&gt;setRowHeight(-1);
  }
  
          header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
          header('Content-Disposition: attachment;filename="activity_export-'.date('Y-m-d').'.xlsx"');
          header('Cache-Control: max-age=0');
          $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
          $objWriter-&gt;save('php://output');
            throw new sfStopException();
  </code></pre>
  
  <p>If someone can spot the problem I would be grateful!</p>