Introducing Workbook, a new rubygem to make working with workbooks (container of spreadsheets) easier

An article, posted more than 8 years ago filed in programming, template, ruby, gem, openoffice, table, export, microsoft, excel, spreadsheet, file, csv, Calc, rubygems, workbook, import, styling, diff & rubygems by murb.

Sorry non-techies, this is really for (ruby-)techies.

For some time I’ve been working on a ruby gem that helps me on my project work, and may also help other ruby programmers, to work with table imports and exports more easily. Although there are other gems that allow you to read and write to different formats, of which the roo-gem is probably the most well know, I was particularly interested in writing Excel files based on templates.

I wanted to offer my clients more user-friendly Excel files that used some of the more advanced functionality of modern Spreadsheets (AutoFilter, printer styles) that couldn’t be offered by just manipulating styles and formatting using the existing rubygems. Which got me started to think about creating templates to start from, instead of starting from scratch using one of the Gems. Using another Excel file, however, wasn’t as easy as expected and here is where the Workbook gem comes in: to make that easier. Aditionnaly, it is simply easier to style a template in your spreadsheet program of choice (whether it be Excel, Open/LibreOffice, Calc or whatever (although for optimal compatibility with Excel, using Microsoft’s Excel is actually recommended)).

The workbook gem isn’t only about making styling easier. For importers, for example, I try to do a bit of extra type detection for dates and allow for accessing values based on the column names as defined in the header row. Additionally I tried to abstract away the Excel peculiarities and kept as close as possible to an array-like interface, much like (Faster)CSV does.

Already curious? You’ll find the Workbook-gem on RubyGems.

Ok, not yet convinced? Here is a list with more features:

You’ll find the Workbook-gem on RubyGems. If you would like to contribute, please see

Op de hoogte blijven?

Maandelijks maak ik een selectie artikelen en zorg ik voor wat extra context bij de meer technische stukken. Schrijf je hieronder in:

Mailfrequentie = 1x per maand. Je privacy wordt serieus genomen: de mailinglijst bestaat alleen op onze servers.