ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Accessing events of com objects (https://www.excelbanter.com/excel-programming/398500-accessing-events-com-objects.html)

[email protected]

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



All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com