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
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