Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro_BeforeClose event...Possible??
Hi
Would it be possible to catch when a user prematurely ends a macro by 'Ctrl-Break'? I would like to reset the Statusbar (ie set it to False) before quitting the macro. I guess what I'm looking for is an event similar to the Workbook_BeforeClose.. Many thanks for any suggestions SuperJas. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro_BeforeClose event...Possible??
Hi
AFAIK there's no such event -- Regards Frank Kabel Frankfurt, Germany SuperJas wrote: Hi, Would it be possible to catch when a user prematurely ends a macro by 'Ctrl-Break'? I would like to reset the Statusbar (ie set it to False) before quitting the macro. I guess what I'm looking for is an event similar to the Workbook_BeforeClose... Many thanks for any suggestions, SuperJas. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro_BeforeClose event...Possible??
Take a look at Application.EnableCancelKey
-- Rob van Gelder - http://www.vangelder.co.nz/excel "SuperJas" wrote in message ... Hi, Would it be possible to catch when a user prematurely ends a macro by 'Ctrl-Break'? I would like to reset the Statusbar (ie set it to False) before quitting the macro. I guess what I'm looking for is an event similar to the Workbook_BeforeClose... Many thanks for any suggestions, SuperJas. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro_BeforeClose event...Possible??
You can use the Application.EnableCancelKey property to control
how VBA responds to Ctrl+Break. For example Application.EnableCancelKey = xlErrorHandler On Error GoTo ErrHandler: ' ' your code here ' Exit Sub ErrHandler: If Err.Number = 18 Then MsgBox "You pressed break" End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "SuperJas" wrote in message ... Hi, Would it be possible to catch when a user prematurely ends a macro by 'Ctrl-Break'? I would like to reset the Statusbar (ie set it to False) before quitting the macro. I guess what I'm looking for is an event similar to the Workbook_BeforeClose... Many thanks for any suggestions, SuperJas. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Event Procedures: Event on Worksheet to fire Event on another Worksheet | Excel Programming | |||
vba event | Excel Programming | |||
Do Event | Excel Programming | |||
change event/after update event?? | Excel Programming | |||
OnTime event not firing in Workbook_Open event procedure | Excel Programming |