开发者

ruby parseexecel gem - array not implemented

开发者 https://www.devze.com 2022-12-28 15:19 出处:网络
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

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

精彩评论

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

关注公众号