Spreadsheet::Excel and Ole::Storage Error

D

Dan Fitzpatrick

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

http://code.google.com/p/ruby-ole/

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 method `sub' 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:in `send'
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:in `store_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:in `store_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:in `close'
from make_excel.rb:12

Does anyone know how to fix this?

Thanks,

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top