Using WIN32OLE with Excel : Excel « Windows Platform « Ruby






Using WIN32OLE with Excel


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()

 








Related examples in the same category

1.Create a chart in Excel
2.Create a chart and rotate it
3.Set cell value and read it back
4.Add some more sheets