Document_Close event not firing on client machine (works on mine)

A

Alan Silver

Hello,

I have written some VBA code that lives in the Document_Close event
handler. I put this in a template, so any document started from that
template should call the code when the document is closed.

This works fine on my machine, but when I put the template on my
client's machine, the event never fires. The document closes, but the
code is not called. I tried opening a new document from the template,
then putting a MsgBox in the Document_Close event handler for that
document, but that never fired either.

I tried this on another machine in his office and it worked fine there.

My machine is running NT4 (although I tested on a W2K machine here as
well) with Office 97. The machines in his office are running XP Pro. I
tried it there on Office 2000, 2002 and 2003. The same thing happened
(or rather didn't happen) with all three versions on his machine. The
other machine there where it worked was running Office 2002 (I think,
forgot to check).

Any ideas ? TIA
 
C

Chad DeMeyer

Alan,

Could it be that macro security is set to High on that machine, so the
macros are never enabled and you are never prompted to enable them?

Regards,
Chad
 
A

Alan Silver

Chad DeMeyer said:
Alan,

Could it be that macro security is set to High on that machine, so the
macros are never enabled and you are never prompted to enable them?

I forgot to mention that I tried that. It was set to high, but setting
it to Medium didn't help.

Thanx for the reply. Any other ideas ?
 
C

Chad DeMeyer

Alan, just to be sure that you followed that all the way to conclusion:

Once the macros in a project have been disabled, they can't be enabled
without closing and re-opening the project. So if you set security to
Medium with a document created from the template already open, it's
Document_Close macro will still not run when it is closed, until after the
next time you open it. I'm sure you already tried this, but just in case
you haven't, try closing out of Word completely on that machine (after
setting security to Medium), then try running your test again.

Regards,
Chad
 
A

Alan Silver

Chad DeMeyer said:
Alan, just to be sure that you followed that all the way to conclusion:

Once the macros in a project have been disabled, they can't be enabled
without closing and re-opening the project. So if you set security to
Medium with a document created from the template already open, it's
Document_Close macro will still not run when it is closed, until after the
next time you open it. I'm sure you already tried this, but just in case
you haven't, try closing out of Word completely on that machine (after
setting security to Medium), then try running your test again.

Thanx, that worked !! I have another problem with it now, but at least
this one is fixed ;-)

Thanx again. I may be back once I've found out what this other problem
is !!

Alan
 

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