Closed Souravgoswami closed 2 years ago
It's in the documentation.
Well as I said, cell.fill_color
doesn't work on newer versions. It worked in the older version 3.3.33 and those.
Whenever I use this I get
xlsx_to_yaml_rubyXL.rb:80:in `block (3 levels) in <main>': undefined method `fill_color' for #<RubyXL::Cell(1,5): nil, datatype=nil, style_index=30> (NoMethodError)
You are not much of a reader, are you?
> require 'rubyXL'
> require 'rubyXL/convenience_methods'
> workbook = RubyXL::Workbook.new
> cell = workbook[0].add_cell(0,0)
> cell.fill_color
=> "ffffff"
Sorry, don't want to argue. Of course, you know it better.
I was trying to say that:
On the above, I have 3.3.33, and on the bottom I have 3.4.22.
Not sure about add_cell(0, 0), but documentation says it's under "Modifying" category. I don't want to modify my spreadsheet, but just read the cells and read the background colour. Because in my case, the background colour determines boolean values!
I wanted to report that the documentation for cell.fill_color
doesn't match the current behaviour.
In both versions, workbook.worksheets[0][0][0]
returns an instance of RubyXL::Cell
.
Ummm, hello? Where's your require 'rubyXL/convenience_methods'
?
Please read the documentation. Slowly and carefully.
Yup, sorry, it works now. Wasn't aware of that separate file for the method RubyXL::Cell#fill_color()
. Makes sense it reduces the memory footprint. Thank you very much!
I used the gem version 3.3.33, where it's giving me this error:
It's because nil.to_s in Ruby 2.7 is returning frozen string.
So I tried updating to the latest version 3.4.22 where the problem is apparently fixed, now I'm getting this error:
I know something has changed, but I can't find the fill_color method which I used to detect the background colour of the cell.
Any ideas where did the fillcolor go? I can't find it in get* methods. No documentation either. Can only get the font colour now :(