Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default abort macro dialog box

Hi there,

I have a little problem making an dialog box.
In my excel sheet i have a commandbutton who runs through my macro.
Since i don't want other people to abort the macro with Esc or
Ctrl-Break i have put this line in: Application.EnableCancelKey =
xlDisabled

But now people don't have the ability at all to stop the macro. For
some people i think this is anoying because the macro runs for about 2
á 3 minutes.

So what i want is 1 abort key, and when they hit this key there is a
dialog box whith a warning and a 'cancel' and a 'run macro further'
button, somthing like that.

Can someone give me some advice or point me in the right direction?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default abort macro dialog box

The simplest way is to set the enablecancelkey property to xlErrorHandler
and trap the canel key press in an error handler.
You can then prompt them to cancel or continue.
If they press cancel then exit the procedure.
If they press run further then put the resume statement in the error
handler.

Hope this helps
Nick
"Chris" wrote in message
om...
Hi there,

I have a little problem making an dialog box.
In my excel sheet i have a commandbutton who runs through my macro.
Since i don't want other people to abort the macro with Esc or
Ctrl-Break i have put this line in: Application.EnableCancelKey =
xlDisabled

But now people don't have the ability at all to stop the macro. For
some people i think this is anoying because the macro runs for about 2
á 3 minutes.

So what i want is 1 abort key, and when they hit this key there is a
dialog box whith a warning and a 'cancel' and a 'run macro further'
button, somthing like that.

Can someone give me some advice or point me in the right direction?



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
How to abort a w/s calculation in real time? [email protected] Excel Discussion (Misc queries) 7 June 19th 08 04:42 PM
control of dialog macro dialog box. on open Gerry Abbott Excel Programming 0 July 22nd 04 05:41 PM
How to abort executing macro? perfb Excel Programming 1 June 16th 04 07:15 PM
Abort or continue Jason Gatsby Excel Programming 0 August 5th 03 02:16 AM
Abort or continue Ed Ferrero[_4_] Excel Programming 0 August 5th 03 02:01 AM


All times are GMT +1. The time now is 04:16 PM.

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"