title: PHPExcel specific cell formatting from style object
body: <p>I'm using PHPExcel in a project and need to style the cells of the excel sheets.</p>
  
  <p>What I've done is create a PHPExcel style object like this:</p>
  
  <pre><code>$style['red_text'] = new PHPExcel_Style();
  </code></pre>
  
  <p>I then use the set functions on this style to fill up the object like this:</p>
  
  <pre><code>$style['red_text']-&gt;getFont()
          -&gt;applyFromArray(
                  array('name'=&gt;'Arial')
           )
  </code></pre>
  
  <p>Now I am trying to use this style object in a cell. I tried to use the applyFromArray function like this:</p>
  
  <p><code>$objPHPExcel-&gt;getActiveSheet()-&gt;getStyleByColumnAndRow($x, $y)-&gt;applyFromArray( $style['red_text'] );</code></p>
  
  <p>This isn't the way to do it I don't think. To me, this is the most readable and consistent way of assigning the styles but if someone who is more fluent with PHPExcel could direct me towards the proper method I'd be much obliged!</p>
  
  <p>P.S. Excuse the formatting; this is my first post :)</p>
  
  <p>EDIT: just found the error in this: <code>"Invalid style array passed"</code>
  Does this mean I'm creating the style object wrongly?</p>