# Spreadsheet::Excel and Ole::Storage Error

**URL:** <https://www.ruby-forum.com/t/spreadsheet-excel-and-ole-storage-error/133000>\
**Category:** Ruby\
**Created:** [March 26, 2008, 4:54pm UTC](https://www.ruby-forum.com/t/spreadsheet-excel-and-ole-storage-error/133000 "2008-03-26T16:54:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dbf](https://www.ruby-forum.com/u/dbf)\
**Post date:** [March 26, 2008, 4:54pm UTC](https://www.ruby-forum.com/t/spreadsheet-excel-and-ole-storage-error/133000/1 "2008-03-26T16:54:47Z")

</div>

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

> **[GitHub - aquasync/ruby-ole: A library for easy read/write access to OLE...](https://github.com/aquasync/ruby-ole)**
>
> A library for easy read/write access to OLE compound documents for Ruby - GitHub - aquasync/ruby-ole: A library for easy read/write access to OLE compound documents for Ruby

and apply this patch to spreadsheet/excel:

[http://ruby-ole.googlecode.com/svn/trunk/contrib/spreadsheet-excel-ole-storage.patch](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
