Spreadsheet::Excel and Ole::Storage Error

I’m trying to generate large Excel files (larger than OLEWriter can
handle). If I use Ole::Storage found here:

and apply this patch to spreadsheet/excel:

http://ruby-ole.googlecode.com/svn/trunk/contrib/spreadsheet-excel-ole-storage.patch

and run this code:

require ‘rubygems’
require ‘spreadsheet/excel’
xls = Spreadsheet::Excel.new ‘test.xls’
data = (0…255).to_a
10.times do
sheet = xls.add_worksheet
200.times do |i|
sheet.write_row i, 0, data
end
end
xls.close

I get the following error:

/opt/local/lib/ruby/gems/1.8/gems/ruby-ole-1.2.5/lib/ole/
file_system.rb:70:in dirent_from_path': private methodsub’ called
for nil:NilClass (NoMethodError)
from /opt/local/lib/ruby/gems/1.8/gems/ruby-ole-1.2.5/lib/ole/
file_system.rb:278:in dirent_from_path' from /opt/local/lib/ruby/gems/1.8/gems/ruby-ole-1.2.5/lib/ole/ file_system.rb:176:insend’
from /opt/local/lib/ruby/gems/1.8/gems/ruby-ole-1.2.5/lib/ole/
file_system.rb:176:in open' from /opt/local/lib/ruby/gems/1.8/gems/spreadsheet-excel-0.3.5.1/lib/ spreadsheet/workbook.rb:108:instore_ole_file’
from /opt/local/lib/ruby/gems/1.8/gems/ruby-ole-1.2.5/lib/ole/
storage.rb:124:in open' from /opt/local/lib/ruby/gems/1.8/gems/spreadsheet-excel-0.3.5.1/lib/ spreadsheet/workbook.rb:107:instore_ole_file’
from /opt/local/lib/ruby/gems/1.8/gems/spreadsheet-excel-0.3.5.1/lib/
spreadsheet/workbook.rb:95:in store_workbook' from /opt/local/lib/ruby/gems/1.8/gems/spreadsheet-excel-0.3.5.1/lib/ spreadsheet/workbook.rb:29:inclose’
from make_excel.rb:12

Does anyone know how to fix this?

Thanks,

Dan

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs