It takes two clicks to shut down Excel

NDeanMeyer

New Member
Joined
Dec 28, 2006
Messages
17
I have a workbook with a bunch of VB code in it.

I have this workbook and any other workbook open, but this workbook is
not active. I click the X to shut down Excel. It calls the
Workbook_BeforeClose event, then asks if I want to save my work (as it
should). I select "Save All" and the shut down is aborted. It never
makes it to the Workbook_BeforeSave event.

I then click the X a second time, and I'm not prompted to save but the
shut down proceeds with saving all and then closing Excel.

==> Why does it require a second click of the X?

If this workbook is active, all works fine.

I've commented out all event code. Didn't help.

I've deleted my commandbar menu before attempting to close. Didn't
help.

The order in which the workbooks were opened doesn't matter.

What might I be doing in VB to cause this behavior?
 
You see the problem!

You're onto the problem now! Thanks for replicating and reassuring me that it's not just me.

I've been on the phone to Microsoft support for a couple of hours now, and I've been kicked between US and India six time and I still can't get to anyone who knows Excel and VB. Very frustrating!

Any ideas on the cause or a workaround?

Sure do appreciate your help!

--Dean
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Actually, now I can't seem to make it fail. I think it did once, but I've opened and closed and edited in several different patterns and orders, and now it seems to be "working". But I know what I saw, it's just a matter of finding the right sequence. Having spent 10 years in tech support tracking stuff like this down, I've got experience, I just need a little more time.
 
Upvote 0
Given: book1 has no macros, book2 has WindowDeactivate macro, any other books with or without macros.

Open book1 first, book2 last, any others (with or without macros in them) in between okay.
Make changes to all work books, or only to book2. Either way works as long as change to book2 is made.
Activate book1, click the big red X and choose Yes (not Yes to all) for any books that you changed.
Screen will not close.
Happens every time.
 
Upvote 0
Problem verified, no fix or workaround known at this time

I think the bug is as simple as this:

If a workbook traps the Workbook_Deactivate or Workbook_WindowDeactivate events in its VB code,

and if that workbook needs to be saved (changes have been made),

and if that workbook is not active (any other workbook is active,

THEN the big red X to close Excel will bomb, but the next red X will save and close the files.

I spent 3.5 hours on the phone trying to get someone at Microsoft qualified to talk to me -- not only no luck (all customer support and technical support were not competent to deal with VB), but at the end they were rude about it. They said I'm not qualified to recognize a bug, and if I want to report it, I'd have to pay them for "support"! So much for the evil empire!

I then spoke to a friend at Microsoft headquarters. He said they're not the least bit interested in fixing Excel 2003 now that 2007 is out.

What fun... we get to discover a whole new set of bugs in 2007!

I thought of using the Application_WorkbookActivate event to catch a deactivate on the way into the next workbook. But if you're working with a set of workbooks and close the first one you loaded, the event trap disappears (it's not passed along to the next in line)! Another bug, I presume.

Anyhow, I could find no fix and no workaround. So I'm going to have to do without the functionality I'd intended based on the Deactivate events.

Thanks for pitching in, my friend!

--Dean
 
Upvote 0
Dean, I think the big lesson to learn here is that before you waste 3.5 hours on the phone with the Customer Abuse line, call your friend at HQ!!

Anyway, I had a grand time of it. Love to troubleshoot bugs in MS products, even though I too am unqualified to do so or even recognize one. Curious what the qualifications are for such an esteemed position?

Ah well, back to our regularly scheduled work-around.
 
Upvote 0

Forum statistics

Threads
1,216,119
Messages
6,128,946
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top