Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
LRL LRL is offline
external usenet poster
 
Posts: 2
Default Deleting a menu in BeforeClose but user Cancels the Save

I have a custom menu which I delete in the Workbook_BeforeClose subroutine.
If the user cancels the save, the menu is gone but the spreadsheet is still
open.

I need to be able to delete the menu under the conditions that the user goes
ahead and either saves or doesn't save the spreadsheet but closes it, as well
as retaiin or recreate the menu under the condition that he cancels the
save/don't save and keeps the spreadsheet open.

Any ideas?

Thanks

Leslie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Deleting a menu in BeforeClose but user Cancels the Save

Hi

Use this two events in the Thisworkbook module.
Read more about events on Chip Pearson's site.

http://www.cpearson.com/excel/events.htm

Private Sub Workbook_Activate()

End Sub

Private Sub Workbook_Deactivate()

End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"LRL" wrote in message ...
I have a custom menu which I delete in the Workbook_BeforeClose subroutine.
If the user cancels the save, the menu is gone but the spreadsheet is still
open.

I need to be able to delete the menu under the conditions that the user goes
ahead and either saves or doesn't save the spreadsheet but closes it, as well
as retaiin or recreate the menu under the condition that he cancels the
save/don't save and keeps the spreadsheet open.

Any ideas?

Thanks

Leslie



  #3   Report Post  
Posted to microsoft.public.excel.programming
LRL LRL is offline
external usenet poster
 
Posts: 2
Default Deleting a menu in BeforeClose but user Cancels the Save

Hi

Thanks for the information. I placed breakpoints in the Workbook_Activate
and Workbook_Deactivate routines but neither were called after cancelling the
Save dialog. As far as I can tell, neither routine is involved after the Save
dialog is dismissed via the Cancel button.

The _Activate does have a call to my createMenu routine and the _Deactivate
calls my deleteMenu routine.

Is there something I need to do to get the Activate/Deactivate to get called
after the Save dialog is dismissed via the Cancel button?

Thanks


"Ron de Bruin" wrote:

Hi

Use this two events in the Thisworkbook module.
Read more about events on Chip Pearson's site.

http://www.cpearson.com/excel/events.htm

Private Sub Workbook_Activate()

End Sub

Private Sub Workbook_Deactivate()

End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"LRL" wrote in message ...
I have a custom menu which I delete in the Workbook_BeforeClose subroutine.
If the user cancels the save, the menu is gone but the spreadsheet is still
open.

I need to be able to delete the menu under the conditions that the user goes
ahead and either saves or doesn't save the spreadsheet but closes it, as well
as retaiin or recreate the menu under the condition that he cancels the
save/don't save and keeps the spreadsheet open.

Any ideas?

Thanks

Leslie




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
I am using a macro and it cancels my formula Nelly Excel Worksheet Functions 3 September 6th 09 05:40 PM
SAVE and SAVE AS options disappeared from the drop down FILE menu [email protected] Excel Discussion (Misc queries) 2 July 12th 07 09:14 AM
Cancel Macro is user selects 'cancel' at save menu Mark Excel Programming 1 April 6th 05 05:45 PM
Save & Save As features in file menu of Excel Blue Excel Discussion (Misc queries) 9 December 27th 04 08:49 PM
Using BeforeClose for deleting a custom toolbar daithimcc[_5_] Excel Programming 3 February 1st 04 10:57 PM


All times are GMT +1. The time now is 11:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"