Word Doc with 'Application Events' via IE

B

Boris D.

2 word docs Doc1.doc, Doc2.doc with the same VBA
including Application Event app_DocumentBeforeClose
opened from Internet Explorer.

When I close one of them I got
************************************************************
"Run-time error 5825. Object has been deleted."
************************************************************

Without Internet Explorer it everything is OK.
--------------------------

Here is the VBA source:

Modules. pkmkModule.
-----------------------------------
Option Explicit
Dim Ev As New EventClass

Public Sub AutoOpen()
Set Ev.app = Word.Application
End Sub


Class Modules. EventClass.
--------------------------------
Option Explicit
Public WithEvents app As Word.Application

Private Sub app_DocumentBeforeClose(ByVal aDoc As
Document, aCancel As Boolean)

aCancel = False
MsgBox "aDoc=" & aDoc.FullName

End Sub
--------------------------------
 
Top