开发者

ruby parseexecel gem - array not implemented

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

So I have code

require 'parseexcel'
#Open the excel file pa开发者_C百科ssed 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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜