Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Exit an entire task ?

The problem I have is that I have a msgbox which gives the operator the
opportunity to Exit the task. This procedure was part of the code
behind a Userform. Once they click Cancel the Exit Sub executes with
control reverting back to the original sub routine with the Userform
still present on the screen. What I need is to have the click of the
Cancel to completely close the task.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Exit an entire task ?

Hi
If you have
MsgBox "Click Cancel to abandon this procedure", vbOKCancelOnly, "Help"

you need to replace it with

Response = MsgBox("Click Cancel to abandon this procedure",
vbOKCancelOnly, "Help")

declaring response as a Variant will do. Now in your main sub you have

If Response = vbCancel then Exit sub


regards
Paul

Old Dog wrote:
The problem I have is that I have a msgbox which gives the operator the
opportunity to Exit the task. This procedure was part of the code
behind a Userform. Once they click Cancel the Exit Sub executes with
control reverting back to the original sub routine with the Userform
still present on the screen. What I need is to have the click of the
Cancel to completely close the task.


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
dialog box for active cell task to speed repeditive task Todd F.[_2_] Excel Programming 3 August 9th 05 02:30 PM
exit while? Steven Deng Excel Programming 1 November 6th 04 12:14 AM
Exit when its a Mac jose luis Excel Programming 0 September 20th 04 10:47 PM
exit sub mike allen[_2_] Excel Programming 4 August 6th 04 05:39 PM
If a called sub exit, how to the caller exit right away? luvgreen[_4_] Excel Programming 4 February 24th 04 05:06 PM


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