views:

17

answers:

1

I am trying to work with two worksheets at the same time.

So I have code

require 'parseexcel'
#Open the excel file passed in from the commandline
workbook = Spreadsheet::ParseExcel.parse(ARGV[0])
workbook2 = Spreadsheet::ParseExcel.parse(ARGV[1])

#Get the first worksheet
worksheet = workbook.worksheet(0)
worksheet2 = workbook2.worksheet(0)

However, when I run this code I get an error: array is not implemented

This error goes away when I comment out line:

workbook2 = Spreadsheet::ParseExcel.parse(ARGV[1])

Why is this happeneing?

Way I am running script is: ruby -rubygems traverse.rb excel.xls so.xls

A: 

i fixed it by copy pasting so.xls in excel.xls as a different workbook. then just accessed it by workbook.worksheet(1) that worked

josh