# WIN32OLE - failed to create WIN32OLE

**URL:** <https://www.ruby-forum.com/t/win32ole-failed-to-create-win32ole/123665>\
**Category:** Ruby\
**Created:** [December 19, 2007, 4:40pm UTC](https://www.ruby-forum.com/t/win32ole-failed-to-create-win32ole/123665 "2007-12-19T16:40:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a9adbd/32.png) [@zxem](https://www.ruby-forum.com/u/zxem)\
**Post date:** [December 19, 2007, 4:40pm UTC](https://www.ruby-forum.com/t/win32ole-failed-to-create-win32ole/123665/1 "2007-12-19T16:40:53Z")

</div>

I am trying to create a ruby class base on a Win32 COM typelib info.  
The class I tried to create is as followed.

COM Type info: (There is no registry entry for this class)

[  
uuid(0058FFFF-5B03-11D3-A520-00805F9BE596),  
helpstring(“Static members of FOHoard”),  
helpcontext(0x00580000),  
hidden  
]  
dispinterface FOHoardHelper {  
properties:  
methods:  
[id(00000000), propget, hidden, helpstring(“The type name  
of this object instance (Default)”)]  
BSTR Item();  
[id(0x00007ffd), hidden, helpstring(“Returns a reference  
to this helper instance”), helpcontext(0x00007ffd)]  
FOHoardHelper\* Me();  
[id(0x00580002), helpstring(“Create a new empty hoard  
(collection)”), helpcontext(0x00580002)]  
FOHoard\* createEmpty();  
};

Ruby class:

class FOHoardHelper  
include WIN32OLE::VARIANT  
attr\_reader :lastargs  
attr\_reader :dispatch  
attr\_reader :clsid  
attr\_reader :progid

def initialize(obj = nil)  
@clsid = “{0058FFFF-5B03-11D3-A520-00805F9BE596}”  
if obj.nil?  
@dispatch = WIN32OLE.new @clsid  
else  
@dispatch = obj  
end  
end

def createEmpty()  
ret = @dispatch.\_invoke(5767170, [], [])  
@lastargs = WIN32OLE::ARGV  
ret  
end

end

My test code:  
f = FOHoardHelper.new;  
hlist = f.createEmpty;

I got this error message:  
F:/NetBeansProjects/TAVolTest/lib/CalendarUtils.rb:45:in `initialize': failed to create WIN32OLE object from`{0058FFFF-5B03-11D3-  
A520-00805F9BE596}’ (WIN32OLERuntimeError)

```
HRESULT error code:0x80040154

```

Could you give me some help?

---

<div class="post-metadata">

**Author:** ![zxem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a9adbd/32.png) [@zxem](https://www.ruby-forum.com/u/zxem)\
**Post date:** [December 19, 2007, 8:07pm UTC](https://www.ruby-forum.com/t/win32ole-failed-to-create-win32ole/123665/2 "2007-12-19T20:07:12Z")

</div>

On Dec 19, 3:37 pm, zxem [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> ]
> 
> ```
> 
> (collection)"), helpcontext(0x00580002)]  
> attr\_reader :progid  
> def createEmpty()
> 
> I got this error message:  
> F:/NetBeansProjects/TAVolTest/lib/CalendarUtils.rb:45:in `initialize': failed to create WIN32OLE object from `{0058FFFF-5B03-11D3-  
> A520-00805F9BE596}’ (WIN32OLERuntimeError)
> 
> ```
> HRESULT error code:0x80040154
> 
> ```
> 
> Could you give me some help?

Please ignore my question
