Ruby 调用 Windows Excel 来生成电子表格

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

require 'win32ole'

excelobj = WIN32OLE.new("excel.application")

excelobj['Visible']=TRUE
excelobj.workbooks.add()


excelobj.Range("a6")['Value'] = 100


excelobj.Range("a1")['Value'] = 100
excelobj.Range("a2")['Value'] = 200
excelobj.Range("a3")['Value'] = 300
excelobj.Range("a4")['Value'] = 400
excelobj.Range("a1:a4").select()