require 'win32ole'
excel = WIN32OLE.new("excel.application")
excel.visible = false
workbook = excel.workbooks.open("E:\\aaa.xls")#excel文档位置
worksheet=workbook.worksheets(1)
#worksheet=workbook.worksheets("sheet name")
data=[]
row=1
while worksheet.range("a#{row}").value#读取并输出a列row行的数据
data << worksheet.range("a#{row}").value.to_s
row+=1
puts(data.length())
puts(worksheet.range("a#{row}").value)
puts ("row="+row.to_s)
end
workbook.close
excel.Quit