title: Not able to style Excel with spreadsheet gem (Ruby)
body: <p>Trying to style an excel following - <a href="https://stackoverflow.com/questions/7730112/ruby-spreadsheet-row-background-color">ruby spreadsheet row background color</a> but nothing is happening for me -</p>
  
  <p>Here goes my code -</p>
  
  <p>My formats:</p>
  
  <pre><code>pass_format = Spreadsheet::Format.new :color=&gt; :blue, :pattern_fg_color =&gt; :green, :pattern =&gt; 1
  fail_format = Spreadsheet::Format.new :color=&gt; :blue, :pattern_fg_color =&gt; :red, :pattern =&gt; 1
  skip_format = Spreadsheet::Format.new :color=&gt; :blue, :pattern_fg_color =&gt; :yellow, :pattern =&gt; 1
  </code></pre>
  
  <p>Trying to use them here(just showing one rest are decided by if elses):</p>
  
  <pre><code>sheet1.row(counter).default_format = skip_format
  sheet1[counter, 3] = 'Skipped'
  sheet1.row(counter).default_format = skip_format
  sheet1.row(counter).set_format(3, skip_format)
  </code></pre>
  
  <p>Counter is the row I am currently in. Here I am not sure whether I should format first or write first. What am I doing wrong? How to fix this?</p>
  
  <p>Actually it's getting applied as I found from .inspect-</p>
  
  <pre><code>#&lt;Spreadsheet::Format:0x007f082f9c1d58 @font=#&lt;Spreadsheet::Font:0x007f082f9c1a88 @name="Arial", @color=:red, @previous_fast_key=nil, @size=nil, @weight=nil, @italic=nil, @strikeout=nil, @outline=nil, @shadow=nil, @escapement=nil, @underline=nil, @family=:swiss, @encoding=nil&gt;, @number_format="GENERAL", @rotation=0, @pattern=1, @bottom_color=:black, @top_color=:black, @left_color=:black, @right_color=:black, @diagonal_color=:black, @pattern_fg_color=:yellow, @pattern_bg_color=:pattern_bg, @regexes={:date=&gt;/[YMD]/, :date_or_time=&gt;/[hmsYMD]/, :datetime=&gt;/([YMD].*[HS])|([HS].*[YMD])/, :time=&gt;/[hms]/, :number=&gt;/[#]/}, @used_merge=0&gt;
  </code></pre>
  
  <p>but even if it shows color red here in excel it's black. :(</p>
  
  <p>I am editing the original file then writing in a new file as</p>
  
  <pre><code> book.write "Result.xls"
  </code></pre>
  
  <p>Is it the wrong approach? I am going to try to make a new workbook before editing and update.</p>