weshatheleopard / rubyXL

Ruby lib for reading/writing/modifying .xlsx and .xlsm files
MIT License
1.28k stars 255 forks source link

Fail when parsing a file generated with change_column_width #296

Closed tomfletch closed 6 years ago

tomfletch commented 6 years ago

The following fails:

require 'rubyXL'
workbook = RubyXL::Workbook.new
worksheet = workbook.add_worksheet("test")
worksheet.change_column_width(0, 50)
worksheet.add_cell(1,1, 'Some Stuff')
workbook.write("result.xlsx")

RubyXL::Parser.parse("result.xlsx")

Error:

rubyXL/objects/sheet_data.rb:128:in `index_in_collection': undefined method `-' for nil:NilClass (NoMethodError)

But commenting out the change_column_width line succeeds

This has been seen before in #248

remi-wakeo commented 4 years ago

Had the same issue on Ruby 2.6.5, Rails 5.2.0 I had to use a version < to 3.4 (I used 3.3.33)