PC Review


Reply
Thread Tools Rate Thread

Capture close excel event in .xla

 
 
Tournifreak
Guest
Posts: n/a
 
      15th Jul 2008
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.

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      15th Jul 2008
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)

"Tournifreak" <(E-Mail Removed)> wrote in message
news:9ab1bd70-f15b-4be1-bd87-(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      15th Jul 2008
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)

"Tournifreak" <(E-Mail Removed)> wrote in message
news:9ab1bd70-f15b-4be1-bd87-(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
Tournifreak
Guest
Posts: n/a
 
      15th Jul 2008
On 15 Jul, 10:25, "Bob Phillips" <bob....@somewhere.com> wrote:
> 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)
>
> "Tournifreak" <wendy...@ntlworld.com> wrote in message
>
> news:9ab1bd70-f15b-4be1-bd87-(E-Mail Removed)...
>
> > 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.


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.
 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      15th Jul 2008
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)

"Tournifreak" <(E-Mail Removed)> wrote in message
news:ac115850-be80-424b-96e4-(E-Mail Removed)...
> On 15 Jul, 10:25, "Bob Phillips" <bob....@somewhere.com> wrote:
>> 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)
>>
>> "Tournifreak" <wendy...@ntlworld.com> wrote in message
>>
>> news:9ab1bd70-f15b-4be1-bd87-(E-Mail Removed)...
>>
>> > 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.

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



 
Reply With Quote
 
Tournifreak
Guest
Posts: n/a
 
      15th Jul 2008
On 15 Jul, 11:37, "Bob Phillips" <bob....@somewhere.com> wrote:
> 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)
>
> "Tournifreak" <wendy...@ntlworld.com> wrote in message
>
> news:ac115850-be80-424b-96e4-(E-Mail Removed)...
>
> > On 15 Jul, 10:25, "Bob Phillips" <bob....@somewhere.com> wrote:
> >> 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)

>
> >> "Tournifreak" <wendy...@ntlworld.com> wrote in message

>
> >>news:9ab1bd70-f15b-4be1-bd87-(E-Mail Removed)...

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

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


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

Thanks!

Jon.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Capture application close event Tom Grillot Microsoft Access 2 3rd Feb 2006 10:40 PM
Capture Close Button Event John Microsoft Dot NET Framework Forms 3 29th Oct 2005 01:10 AM
Capture the Browser Close event =?Utf-8?B?QmlsbCBNYW5yaW5n?= Microsoft ASP .NET 4 8th Mar 2005 01:15 AM
Capture the before close event Yahya Saad Microsoft Outlook Program Addins 2 8th Nov 2004 08:15 AM
Re: How to Capture MS Access close event ? Douglas J. Steele Microsoft Access Security 2 29th Aug 2003 07:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:54 PM.