Sha256: c9cc3e81c039bd65e7fec0b5f4191930cdf9070495bf4b17f3e48b9f9a030481

Contents?: true

Size: 568 Bytes

Versions: 6

Compression:

Stored size: 568 Bytes

Contents

# frozen_string_literal: false
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}"

print "Now quit Excel... Please enter."
gets

application.ActiveWorkbook.Close(0);
application.Quit();

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
win32ole-1.9.1 sample/win32ole/excel3.rb
win32ole-1.9.0 sample/win32ole/excel3.rb
win32ole-1.8.10 ext/win32ole/sample/excel3.rb
win32ole-1.8.9 ext/win32ole/sample/excel3.rb
win32ole-1.8.8 ext/win32ole/sample/excel3.rb
ruby-compiler-0.1.1 vendor/ruby/ext/win32ole/sample/excel3.rb