WIN32OLE.ole_show_help problem

Hi,

ruby 1.8.6 (2009-03-31 patchlevel 368) [i386-mswin32_90]
Vista Home Premium
Excel 2007

Here’s the documentation for WIN32OLE.ole_show_help in win32ole.c:

/*

  • call-seq:
  • WIN32OLE.ole_show_help(obj [,helpcontext])
    
  • 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)
    

*/

When I tried to run that sample I got:

irb(main):005:0> excel = WIN32OLE.new(‘Excel.Application’)
=> #WIN32OLE:0x45fdf08
irb(main):006:0> typeobj = excel.ole_type
WIN32OLERuntimeError: unknown property or method ole_type' HRESULT error code:0x80020006 Unknown name. from (irb):6:inmethod_missing’
from (irb):6

Any ideas?

Regards,

Dan

Hello,

At 08/29/2009 05:11 AM, Daniel B. wrote:

irb(main):005:0> excel = WIN32OLE.new(‘Excel.Application’)
=> #WIN32OLE:0x45fdf08
irb(main):006:0> typeobj = excel.ole_type
WIN32OLERuntimeError: unknown property or method ole_type' HRESULT error code:0x80020006 Unknown name. from (irb):6:inmethod_missing’
from (irb):6

Any ideas?

Sorry, this is the bug of comment of win32ole.c.
WIN32OLE#ole_type is available in Ruby 1.9.
Instead, try
typeobj = WIN32OLE_TYPE.new(‘Microsoft Excel 12.0 Object Library’,
‘Application’)

Regards,
Masaki S.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs