Accessing events of com objects

T

tixover_lives

Hi All

first appologies if I get all the terminology wrong, It is ages since
I have done any of this and I am rusty....

I am working with an API which exposes its objects to me but is not
available as an object within excel (late bound??) so I access it
using

Dim MyObj as Object
Set MyObj = GetObject("FOO")

Rather than being able to do:

Dim MyObj as FOO

because the objects are not registered (and I cannot count on them
being on the target machines)

I can access the properties of MyObj at runtime:
Dim MyObj as Object
Dim Counter as integer
Set MyObj = GetObject("FOO")
Counter = MyObj.Count

but I know it has 2 events and I want to be able to catch those (in
WScript I think I can use "ConnectObject") - is there a way of setting
the event handlers to be part of my VBA (either in a class module or
normal module)

T
 

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

Top