Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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
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
Event Procedures: Event on Worksheet to fire Event on another Worksheet Kathryn Excel Programming 2 April 7th 04 07:35 PM
vba event Daniel P Excel Programming 4 February 20th 04 03:29 PM
Do Event John Gittins Excel Programming 1 October 22nd 03 04:58 PM
change event/after update event?? scrabtree23[_2_] Excel Programming 1 October 20th 03 07:09 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


All times are GMT +1. The time now is 11:39 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"