ext/win32ole/sample/excel3.rb


DEFINITIONS

This source file includes following functions.


   1  require 'win32ole'
   2  
   3  #application = WIN32OLE.new('Excel.Application.5')
   4  application = WIN32OLE.new('Excel.Application')
   5  
   6  application.visible = TRUE
   7  workbook = application.Workbooks.Add();
   8  sheet = workbook.Worksheets(1);
   9  sheetS = workbook.Worksheets
  10  puts "The number of sheets is #{sheetS.count}"
  11  puts "Now add 2 sheets after of `#{sheet.name}`"
  12  sheetS.add({'count'=>2, 'after'=>sheet})
  13  puts "The number of sheets is #{sheetS.count}"