From: Ayumu Aizawa Date: 2010-05-13T16:35:13+09:00 Subject: Re: Reading Data From Excel File This program may be your want, but also you can use Selenium or Mechanize. see below - http://seleniumhq.org/ - http://mechanize.rubyforge.org/mechanize/ --- require 'rubygems' require 'win32ole' require 'watir' include Watir begin #Open Excel File excel = WIN32OLE::new('excel.Application') excel.DisplayAlerts = false workbook = excel.Workbooks.Open('C:\tmp\POC.xls') #Loop through the worksheets for i in 1 .. workbook.Worksheets.Count worksheet = workbook.Worksheets(i) rowcount = worksheet.UsedRange.Rows.Count for j in 2..rowcount keyword =worksheet.Cells(j, 1).value object_prop_name = worksheet.Cells(j, 2).value object_Ppop_value = worksheet.Cells(j, 3).value expected_output = worksheet.Cells(j, 4).value parm_01 = worksheet.Cells(j, 6).value case keyword when /^OpenURL/ ie=IE.start(parm_01) #~ @Browser.maximize when /^SetText/ ie.text_field(:"#{object_prop_name}",object_Ppop_value).set(parm_01) when/^ClickButton/ ie.button(:"#{object_prop_name}", object_Ppop_value).click when/^ClickLink/ ie.link(:"#{object_prop_name}", object_Ppop_value).click when/^CloseURL/ ie.close end end end workbook.Close() excel.quit() rescue workbook.Close() excel.quit() end --- Ayumu AIZAWA http://twitter.com/ayumin 2010/5/13 John Allen : > > So are you getting the same warning messages??  Since those were > Warnings and not Errors, your program should still have done something. > When you say its not running, are you getting errors, or it not working > the way you want it to?? > > -- john > > -- > Posted via http://www.ruby-forum.com/. > >