views:

108

answers:

4

What is the best Ruby library for dealing with Excel spreadsheets?

I found spreadsheet-gem but I didn't find it to be as good as PHPExcel - a library I used to use when I was a PHP developer.

Please help.
Thanks.

A: 

spreadsheet looks good

greg
A: 

I think roo is the best gem you can get at this time. It's not almighty but might be helpful.

Milan Novota
Yes, but with roo you can read Excel files but not write
greg
+1  A: 

win32ole

There are some quirks, but I've been able to do anything I've wanted with excel spreadsheets.

excel = WIN32OLE.new('Excel.Application')
excel.visible = true

workbook = excel.workbooks.open('myspreadsheet.xls')
worksheet = workbook.worksheets("Sheet1")
worksheet.Activate

somevalue = worksheet.Cells(row, column).Value
worksheet.Cells(row, column).Value = some_other_value

I've yet to find great documentation but a good rule of thumb is between .methods.sort and doing something as an excel macro recording first you can figure a lot of stuff out.

Good luck.

Beanish
A: 

I think FasterCSV is also worth to be mentioned, although I don´t know if it can handle .xls files directly. It´s quite easy to use.

sudo gem install fastercsv
auralbee