you need to pass (row,column) for the function
sheet1.getCellByPosition(id)...arity of this function is 2.




On Sat, Jan 17, 2009 at 2:01 AM, dmitry...@gmail.com <dmitry...@gmail.com>wrote:

>
> Hello everyone,
> Running into an issue, would really appreciate some help.
>
> I have to files. One has a method with arguments defined for the Open
> Office Calc code like so:
>
> firstscript.rb:
>
> class FirstTest
>   def test(id)
>                noArgs = []
>                file_uri = "file:///c:/test.ods"
>
>                serviceManager = WIN32OLE.new("com.sun.star.ServiceManager")
>                coreReflection = serviceManager.createInstance
> ("com.sun.star.reflection.CoreReflection")
>                desktop = serviceManager.createInstance
> ("com.sun.star.frame.Desktop")
>                spreadsheet = desktop.loadComponentFromURL(file_uri,
> "_blank", 0,
> noArgs)
>                sheetsCollection = spreadsheet.Sheets
>                sheet1 = sheetsCollection.getByIndex(0)
>
>                                $browser.text_field(:id,
> 'position_req_id').value = sheet1.getCellByPosition(id).Formula
>   end
> end
>
> My other script sets the id:
>
> require "firstscript"
>
>                                FirstTest.new.test (1, 0)
>
> results in an error:
>
>    method_missing': getCellByPosition (WIN32OLERuntimeError)
>    OLE error code:1001 in [automation bridge]
>       InterfaceOleWrapper_Impl::Invoke :
>    [automation bridge]UnoConversionUtilities<T>::variantToAny
>    Cannot convert the value of vartype :"8"  to the expected UNO type
> of type class: 6
>    HRESULT error code:0x80020009
>
>
> Any ideas?
>
> Thank you.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to