Ruby 操作excel
使用ruby生成excel
操作方法
- 01
直接上代码: require 'win32ole' excel = WIN32OLE.new("excel.application") excel.Visible = true excel.WorkBooks.Add excel.Range("a1").Value = 3 excel.Range("a2").Value = 2 excel.Range("a3").Value = 1 excel.Range("a1:a3").select excel_chart = excel.charts.add excel_chart.type = -4100 excel.ActiveWorkbook.SaveAs('f:\\test.xlsx') excel.ActiveWorkbook.Close(0) excel.Quit()
赞 (0)