Ask the Expert

Handle events of distant OLE objects inside Notes

I am looking for a solution to handle from inside Lotus Notes with LotusScript events of distant OLE objects.

More precisely: how could I open an OLE connection for example to an Excel Spreadsheet and get/trap with LotusScript the click event on a button in the Excel Spreadsheet. In other words: How could I make my LotusScript in Lotus Notes react to the Button-Click event in the Excel Spreadsheet? LotusScript gives the opportunity to access properties and methods of OLE objects, but does it give the opportunity to handle/trap events of OLE objects?

There is an OnEvent method defined in Notes' LotusScript that allows you to design custom event handlers, but it is only available for Lotus native events (those defined within Notes). However, I have two suggested workarounds:

1. Have Excel perform Automation on Notes when the event fires in Excel.
Just have Excel perform an OLE automation (contacting Notes, performing whatever event handler you want, closing the connection to Notes).

2. Have Excel write something to a text file on the hard drive that Notes hangs around looking for (using the NotesTimer object), and performs the event handler code in Notes when it sees that item appear on the hard drive (have it check every second or something).

Personally, I like the first choice -- I think it's cleaner and neater (and cooler). But I haven't tried it between Notes and Excel. I have done something similar a long time ago between WordPro and Notes, and it worked pretty well.

This was first published in April 2002

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: