invoke

WIN32OLE#invoke(method, [arg1,...]) => return value of method. Instance Public methods Runs OLE method. The first argument specifies the method name of OLE Automation object. The others specify argument of the method. If you can not execute method directly, then use this method instead. excel = WIN32OLE.new('Excel.Application') excel.invoke('Quit') # => same as excel.Quit

each

WIN32OLE#each {|i|...} Instance Public methods Iterates over each item of OLE collection which has IEnumVARIANT interface. excel = WIN32OLE.new('Excel.Application') book = excel.workbooks.add sheets = book.worksheets(1) cells = sheets.cells("A1:A5") cells.each do |cell| cell.value = 10 end

_setproperty

WIN32OLE#_setproperty(dispid, args, types) Instance Public methods Runs the early binding method to set property. The 1st argument specifies dispatch ID, the 2nd argument specifies the array of arguments, the 3rd argument specifies the array of the type of arguments. excel = WIN32OLE.new('Excel.Application') excel._setproperty(558, [true], [WIN32OLE::VARIANT::VT_BOOL]) # same effect as excel.visible = true

_invoke

WIN32OLE#_invoke(dispid, args, types) Instance Public methods Runs the early binding method. The 1st argument specifies dispatch ID, the 2nd argument specifies the array of arguments, the 3rd argument specifies the array of the type of arguments. excel = WIN32OLE.new('Excel.Application') excel._invoke(302, [], []) # same effect as excel.Quit

_getproperty

WIN32OLE#_getproperty(dispid, args, types) Instance Public methods Runs the early binding method to get property. The 1st argument specifies dispatch ID, the 2nd argument specifies the array of arguments, the 3rd argument specifies the array of the type of arguments. excel = WIN32OLE.new('Excel.Application') puts excel._getproperty(558, [], []) # same effect as puts excel.visible

[]=

WIN32OLE[a1, a2, ...]=val Instance Public methods Sets the value to WIN32OLE object specified by a1, a2, ⦠dict = WIN32OLE.new('Scripting.Dictionary') dict.add('ruby', 'RUBY') dict['ruby'] = 'Ruby' puts dict['ruby'] # => 'Ruby' Remark: You can not use this method to set the property value. excel = WIN32OLE.new('Excel.Application') # excel['Visible'] = true # This is error !!! excel.Visible = true # You should to use this style to set the property.

[]

WIN32OLE[a1,a2,...] Instance Public methods Returns the value of Collection specified by a1, a2,.⦠dict = WIN32OLE.new('Scripting.Dictionary') dict.add('ruby', 'Ruby') puts dict['ruby'] # => 'Ruby' (same as `puts dict.item('ruby')') Remark: You can not use this method to get the property. excel = WIN32OLE.new('Excel.Application') # puts excel['Visible'] This is error !!! puts excel.Visible # You should to use this style to get the property.

ole_uninitialize

ole_uninitialize() Class Public methods :nodoc

ole_show_help

WIN32OLE.ole_show_help(obj [,helpcontext]) Class Public methods Displays helpfile. The 1st argument specifies WIN32OLE_TYPE object or WIN32OLE_METHOD object or helpfile. excel = WIN32OLE.new('Excel.Application') typeobj = excel.ole_type WIN32OLE.ole_show_help(typeobj)

ole_reference_count

WIN32OLE.ole_reference_count(aWIN32OLE) -â number Class Public methods Returns reference counter of Dispatch interface of WIN32OLE object. You should not use this method because this method exists only for debugging WIN32OLE.