View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] tixover_lives@yahoo.co.uk is offline
external usenet poster
 
Posts: 1
Default Accessing events of com objects

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