Hi,
So I can write
> >   def connect(workbook)
> >   worksheet = workbook.WorkSheets(1)
> >   #Manipulate the workbook cells as in i.e. get the cell values here
> >   end
And have another method ´disconnect´

as this:

> >   def disconnect(workbook)
> >   workbook.close()
> >   end

This will refer to the same object?


Cheers



On Feb 24, 3:59 pm, Tiffany Fodor <[email protected]> wrote:
> Sorry, I should have also included that you can pass 'workbook' to
> methods and write to the file within those methods.
>
> On Feb 24, 1:02 am, [email protected] wrote:
>
> > This might be a ruby question, bit is it possible to have an WIN32OLE
> > object asparameterto 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