summaryrefslogtreecommitdiff
path: root/ext/win32ole/sample/excel3.rb
blob: 0f96717063964f3d7c45deee634dda097c33189e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'win32ole'

#application = WIN32OLE.new('Excel.Application.5')
application = WIN32OLE.new('Excel.Application')

application.visible = TRUE
workbook = application.Workbooks.Add();
sheet = workbook.Worksheets(1);
sheetS = workbook.Worksheets
puts "The number of sheets is #{sheetS.count}"
puts "Now add 2 sheets after of `#{sheet.name}`"
sheetS.add({'count'=>2, 'after'=>sheet})
puts "The number of sheets is #{sheetS.count}"