The Ruby Spreadsheet

February 13, 2009 Ruby Spreadsheet released

Filed under: Release, Ruby, Spreadsheet — Tags: — zdavatz @ 3:02 pm

*   Reduce warnings produced by running under ruby -w
*   Improved auto-formatting for Dates and Times
*   Honor Row, Column, Worksheet and Workbook-formats
*   Merge branch ‘master’ into HEAD
*   Only select the First Worksheet by default;a=summary


1 Comment »

  1. I wonder why when passing a hard-coded String to read an Excel file on Windows network works fine:

    #encoding: utf-8
    require ‘spreadsheet’

    folder = “\\\\server100\\folder1\\folder2”
    file = folder << "\\" << "olé-olé-file.xls"
    Spreadsheet.client_encoding = 'UTF-8' do |book|
    puts "sheets: #{book.worksheets.size}"
    sheet = book.worksheet(0)
    puts "First sheet name: #{}"

    But when I pass the same file name from a variable, it doe not work:

    require 'spreadsheet'

    folder = "\\\\server100\\folder1\\folder2"
    pattern = "ole-olé-*.xls"
    source_files = Dir.glob(pattern)
    recent_file = source_files.max_by { |f1| File.mtime(f1) }
    file = folder << "\\" << recent_file do |book|
    puts "sheets: #{book.worksheets.size}"
    sheet = book.worksheet(0)
    puts "First sheet name: #{}"

    The error I get is the following:

    C:/Ruby193/lib/ruby/gems/1.9.1/gems/spreadsheet-0.6.8/lib/spreadsheet/excel/reader.rb:1172:in `setup': undefined method `read' for false:FalseClass (NoMeth
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spreadsheet-0.6.8/lib/spreadsheet/excel/reader.rb:121:in `read'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spreadsheet-0.6.8/lib/spreadsheet/excel/workbook.rb:32:in `open'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spreadsheet-0.6.8/lib/spreadsheet.rb:62:in `open'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spreadsheet-0.6.8/lib/spreadsheet.rb:65:in `block in open'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spreadsheet-0.6.8/lib/spreadsheet.rb:64:in `open'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spreadsheet-0.6.8/lib/spreadsheet.rb:64:in `open'

    It happened on Windows XP SP3 box, Ruby 1.9.3, spreadsheet 0.6.8
    Thank you

    Comment by belgoros — March 26, 2012 @ 11:27 am

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: