WIN32OLE.ole_show_help problem

D

Daniel Berger

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:in `method_missing'
from (irb):6

Any ideas?

Regards,

Dan
 
M

Masaki Suketa

Hello,

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:in `method_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 Suketa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top