1

I used the below code that I got from a website and once I executed I just got a disc for a few seconds but the excel application did not open.

require 'win32ole'

excel = WIN32OLE::new('excel.Application')
workbook = excel.Workbooks.Add # create a new workbook
worksheet = workbook.Worksheets.Add
knut
  • 27,320
  • 6
  • 84
  • 112
beegee Assem
  • 79
  • 1
  • 3
  • 16

1 Answers1

1

To keep the Excel workbook visible, enable the visible option.

require 'win32ole'

excel = WIN32OLE::new('excel.Application')
# Make Excel visible
excel.visible = true

Look this example too.

Community
  • 1
  • 1
Arup Rakshit
  • 116,827
  • 30
  • 260
  • 317