Wednesday, February 9, 2011

Excel Interface Class

This ruby class provides simple methods for reading and writing data records to and from Excel spreadsheets. This data can then be easily used to create data-driven Watir tests. This class hides the complexities of directly using ruby's win32ole library to interface with Excel.

Excel Data can be identified/located on any sheet using and either a "Range" (e.g. "A1:C20") or dynamically by searching for a specific text label above a data range
Excel Data formated as rows of records or as columns of records can easily be read
Data can be read in as an Array of Hashes (using headers as keys), a plain 2D Array, or a simple Hash of key-value pairs.
If the excel data file is already open, this class will simply attach to the open workbook and read its data instead of trying to re-open the file.
[6/22/07] Support adding and removing excel worksheets
[6/22/07] Support for ordered hashes, and writing them back to an excel file.
[6/25/07] Uploaded the RDOC documentation for the XLS class see
[7/11/07] Made all get methods more flexible in how the range is specified (they now accept a string representing a literal range,a Named Range in the workbook, or a text label above a contiguous range of cells with data). This allowed me to simplify/shorten method names and to remove Redundant methods.

No comments:

Post a Comment