Deactivate Events not Firing
My response on this Doug was that the deactivate event has fired. Aren't the
facts that you are basically asking it to fire a second time? Once when it
was demoted (made Workbook2 active) and again when Excel is closing?
Do I have it wrong?
"Doug Glancy" wrote in message
...
William,
I am able to duplicate exactly as you described it in XL 03. I can also
see what Rob is saying. What's problematic is that when you say yes to
saving the second book and it becomes active, the first book does not fire
a deactivate event, even though it was active when you got the save prompt
for the second book.
The only thing I can think of is using BeforeClose, but then you have
problems if they cancel the Close.
Doug
"William" wrote in message
...
I've encountered a problem with Excel where the deactivate events (for
workbook and window) don't fire in certain situations.
The steps to re-create the problem a
1. You need to have two or more workbooks open in the same instance of
Excel
2. In one of the workbooks, enter some code to detect the deactivate
events
(eg. a message box) and save it
3. In another workbook, make some changes but don't save yet
4. Switch to the workbook with the VBA deactivate code and click the 'x'
(close) button for the whole Excel application
5. Excel should ask you to save the other workbook. Click 'Yes' and Excel
should close but the deactivate event doesn't get fired for the active
workbook.
Does anyone else have the same problem?
It is important for what I am doing that there is a deactivate event for
every activate event. I've not been able to find any information about
this
problem. The version of Excel I am using is 2000 with SP3. I know that
this
problem also occurs with Excel 2003.
If this is a known problem, can someone please direct me to where it is
documented and a workaround if available?
Thank you all
|