Using app events to trap workbooks opening.

A

aah-boy

Hi all,

I've implemented a application level event to 'watch' workbooks
opening as per Chip Pearsons site:

http://www.cpearson.com/excel/AppEvent.htm

- which works fine in 99% of cases - there is just one case which
baffles me...

I launch the workbook from a MS Outlook98 message into Excel98. The
App_WorkbookOpen displays a msgbox for each of the workbooks as it
open them - each one in my xlstart directory but not for the workbook
from the Outlook msg.

Even if I save the attached workbook and click it manually, the event
is still not 'seeing' it.

Using Office2000 this problem doesn't arise.

the only thing I noticed - and this may not be anything, but the
attachment is in a little pane at the bottom of the Outlook window -
ie. not floating at the top near the written message. This may just
be a Outlook setting though.

Is there a difference in 98 application event processing to 2000? and
if so, where do I go from here?

I included my code below.

Any thoughts?

Many thanks,
Dave


In workbook.....


Option Explicit

Dim AppClass As New EventClass

Private Sub Workbook_Open()

Set AppClass.App = Application

End Sub


In EventClass module........


Option Explicit

Public WithEvents App As Application

Private Sub App_WorkbookOpen(ByVal Wb As Excel.Workbook)

MsgBox ("Loading: " & Wb.Name)

End Sub
 

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