require 'win32ole'
excel = WIN32OLE::new('excel.Application')
workbook = excel.Workbooks.Open('H:\rb\123.xls')
worksheet = workbook.Worksheets(1) #定位到第一个sheet
worksheet.Select
temp = worksheet.Range('a12')['Value'] #读取a12中的数据
puts temp
data = worksheet.Range('a1:a12')['Value']
puts data
worksheet.Range('a1:c5')['Value'] = ['Test', '25', 'result'] #将一个数组写入
workbook.Close(1)
excel.Quit