Capture close excel event in .xla

T

Tournifreak

Hi - I hope someone can help.

I'm trying to capture the event where someone closes Excel (using the
red "X"). My code is in an .xla and no other workbooks are open except
the hidden .xla.

My code is in "This Workbook" of the hidden .xla

I've tried:
Workbook_BeforeClose(Cancel As Boolean)
Workbook_WindowDeactivate(ByVal Wn As Window)
Workbook_Deactivate()
Workbook_SheetDeactivate(ByVal Sh As Object)

None are captured - Excel just shuts down without triggering.

The funny thing is, Workbook_Open() does trigger when the xla is
opened.

I'm using Excel 2000 if it makes any difference. Does anyone have any
ideas?

Thanks & regards,
Jon.
 
B

Bob Phillips

I would have thought that workbook close would have been triggered, so I
just tried it. And it did, the close event was triggered as expected.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
B

Bob Phillips

Just noticed your comment re Excel 2000, so I tried it there, and it still
worked.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
T

Tournifreak

Just noticed your comment re Excel 2000, so I tried it there, and it still
worked.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

Hi Bob,
I just found this:
http://support.microsoft.com/kb/q248172/

Seems like this is a bug with the original release of Excel 2000. I'm
not sure if I have the service pack installed, so I'll install it
anyway and report back. Thanks for your help,
Jon.
 
B

Bob Phillips

I didn't know about that bug, but I can confirm that I do have SR-1

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
T

Tournifreak

I didn't know about that bug, but I can confirm that I do have SR-1

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

With SR-1 installed, Workbook_BeforeClose now triggers from within
the .xla

Thanks!

Jon.
 

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