Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Carlos,
I like to put my call to the toolbar delete macro in the WorkbookDeactivate module instead of the BeforeClose. In addition to solving your problem, it also means that the toolbar goes away when you select/open a different workbook. If you do this, you'll also need to call your toolbar create macro in the WorkbookActivate event as well as the Open event, so that the toolbar is created when you switch back to your workbook from the other one. hth, Doug Glancy "Carlos Lozano" wrote in message ... Hi, My application creates a toolbar on Opening (this works fine) and I am trying to delete it when the workbook is closed. I am calling the Toolbar's delete method on the BeforeClose event of the ThisWorkBook Object. The current behavior is below: 1) If the document was not modified, it works perfectly 2) If the document was modified, it prompts to save changes and if "yes" or "No" are selected works fine. The BeforeClose event is executed as expected. 2) If the document was modified, and "cancel" is selected the BeforeClose event is executed. I wasn't expecting this as the workbook was not closed. So, It deletes the toolbar and the workbook remains open (with no toolbar which is a problem). The beforeClose event is executed before the message is shown. How can I know what was selected on the "Do you want to save..." message? to choose the right action. Thank you, Carlos Lozano CAX IT Services |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ThisWorkBook BeforeClose Event | Excel Programming | |||
How to keep spreadsheet open in the BeforeClose event | Excel Programming | |||
Workbook_Beforeclose vs BeforeClose Event | Excel Programming | |||
Cancelling the BeforeClose Event | Excel Programming | |||
BeforeClose event - Savings | Excel Programming |