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
--------------------------------
 

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