Add "Cancel = True" to your code.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
"Dean Meyer"
wrote in message
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?