Passing optional argument to win32 ole subsystem

Hi all,
I am trying to embed a html document in Excel document using Win32OLE.
The VBA Excel reference talks about this by using the OleObject Add
However I am not sure how do I pass the optional argument in ruby which
will understand. Following is the snippet of the sample from VBA

|Set myDocument = Worksheets(1)
myDocument.Shapes.AddOLEObject Left:=100, Top:=100, _ Width:=200,
Height:=300, _ FileName:=“c:\my documents\testing.doc”, link:=True|

I tried passing null, but it failed miserably. I am not sure if I pass
some argument incorrectly
or the method I am using to pass the arguments is incorrect.
Can somebody let me know the exact syntax in ruby to make this call
Any relevant pointers will be appreciated.

Thanks and Regards,

On 2/22/07, Manish S. [email protected] wrote:

Programming Ruby: The Pragmatic Programmer's Guide

Named Arguments

Other automation client languages such as Visual Basic have the
concept of named arguments. Suppose you had a Visual Basic routine
with the signature:

Song(artist, title, length): rem Visual Basic

Instead of calling it with all three arguments in the order specified,
you could use named arguments.

Song title := ‘Get It On’: rem Visual Basic

This is equivalent to the call Song(nil, ‘Get It On’, nil).

In Ruby, you can use this feature by passing a hash with the named
arguments. ‘title’ => ‘Get It On’ )

So basically you just name those arguments you actually need:

myDocument.Shapes.AddOLEObject( ‘Left’ => 100, ‘Top’ => 100, ‘Width’ =>
‘Height’ => 300, ‘FileName’ => “c:\my documents\testing.doc”, ‘link’
=> true)