Hooking into events raised by a latebound object

G

Guest

Hi,

I am trying to figure out if it is possible to hook into events of a latebound object, for instance say I had the following code:

Dim objExcel as Object
objExcel = createobject("Excel.Application")

How could I trap the application_beforerightclick event?. Early binding is not an option and I can not have a reference to excel inside my application.

Thanks for your help.

Regards.....Jim
 
B

BluDog

Dim objExcel as Object
objExcel = createobject("Excel.Application")

How could I trap the application_beforerightclick event?. Early binding is not an option and I can not have a reference to excel inside my application.

Hi

Have a look at the AddHandler Statement:

AddHandler objExcel.BeforeRightClick, AddressOf MyRightClickHandler

Hope this helps

Blu
 
O

One Handed Man \( OHM - Terry Burns \)

If your using Office 2003, then you can get hold of the Visual Studio Tools
For Office VSTO SDK which will allow you to do all manner of stuff like
this.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

jnc said:
Hi,

I am trying to figure out if it is possible to hook into events of a
latebound object, for instance say I had the following code:
Dim objExcel as Object
objExcel = createobject("Excel.Application")

How could I trap the application_beforerightclick event?. Early binding
is not an option and I can not have a reference to excel inside my
application.
 
G

Guest

Unfortunately this approach would require a reference to the excel object model. Anyone know of an approach where I would not have to reference excel?
 
C

Charles Law

Although it pains me to say it

Option Strict Off

will allow you to late bind the handler w/o a reference to the excel object
model. But, can you humour me and say why you can't have a reference?

Charles


jnc said:
Unfortunately this approach would require a reference to the excel object
model. Anyone know of an approach where I would not have to reference
excel?binding is not an option and I can not have a reference to excel inside my
application.
 

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