Hello!

After the line:

workbook = excel.Workbooks.open("C:\\Programfiler\\Ruby\\FPSdata.xls")

the excel file is open and you can write to it with the object
'workbook'.  When you're finished writing to the file, you can do the
following to save and close the file and exit excel:

workbook.SaveAs("C:\\Programfiler\\Ruby\\FPSdata.xls")
workbook.close
excel.Quit

For some great tips on working with excel in Ruby, check out this
website:

http://rubyonwindows.blogspot.com/search/label/excel

I hope this helps!

-Tiffany

On Feb 24, 1:02 am, [email protected] wrote:
> This might be a ruby question, bit is it possible to have an WIN32OLE
> object as parameter to a method?
>
>   excel = WIN32OLE::new("excel.Application")
>   workbook = excel.Workbooks.Open("C:\\Programfiler\\Ruby\
> \FPSdata.xls")
>
>   def connect(workbook)
>   worksheet = workbook.WorkSheets(1)
>   puts "You are now connected to Excel"
>   end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to