Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a subroutine which calls another subroutine. The child subroutine has an error mechanism that displays a message and then is supposed to exit out of the subroutine. Exit Sub only works for the child subroutine, however, and the main subroutine which called the child subroutine still runs. Is there a call or command to exit out of everything? Thanks in advance. -- Raman325 ------------------------------------------------------------------------ Raman325's Profile: http://www.excelforum.com/member.php...o&userid=24748 View this thread: http://www.excelforum.com/showthread...hreadid=544854 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes: Exit Sub
"Raman325" wrote: I have a subroutine which calls another subroutine. The child subroutine has an error mechanism that displays a message and then is supposed to exit out of the subroutine. Exit Sub only works for the child subroutine, however, and the main subroutine which called the child subroutine still runs. Is there a call or command to exit out of everything? Thanks in advance. -- Raman325 ------------------------------------------------------------------------ Raman325's Profile: http://www.excelforum.com/member.php...o&userid=24748 View this thread: http://www.excelforum.com/showthread...hreadid=544854 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A couple of common techniques a
1. Use a global boolean variable and set that in each subroutine. Then you can examine that to see if you should quit or continue. 2. Another way would be to change your child subroutines to functions. Let them return a boolean variable that you can check. Raman325 wrote: I have a subroutine which calls another subroutine. The child subroutine has an error mechanism that displays a message and then is supposed to exit out of the subroutine. Exit Sub only works for the child subroutine, however, and the main subroutine which called the child subroutine still runs. Is there a call or command to exit out of everything? Thanks in advance. -- Raman325 ------------------------------------------------------------------------ Raman325's Profile: http://www.excelforum.com/member.php...o&userid=24748 View this thread: http://www.excelforum.com/showthread...hreadid=544854 -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thank you for all the responses, that helps a lot. -- Raman325 ------------------------------------------------------------------------ Raman325's Profile: http://www.excelforum.com/member.php...o&userid=24748 View this thread: http://www.excelforum.com/showthread...hreadid=544854 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can use the End statement. Be aware that it clears all variables as
well as ending code execution. -- Jim "Raman325" wrote in message ... | | I have a subroutine which calls another subroutine. The child subroutine | has an error mechanism that displays a message and then is supposed to | exit out of the subroutine. Exit Sub only works for the child | subroutine, however, and the main subroutine which called the child | subroutine still runs. Is there a call or command to exit out of | everything? Thanks in advance. | | | -- | Raman325 | ------------------------------------------------------------------------ | Raman325's Profile: http://www.excelforum.com/member.php...o&userid=24748 | View this thread: http://www.excelforum.com/showthread...hreadid=544854 | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Exit Sub | Excel Discussion (Misc queries) | |||
If Then Else with Exit For | Excel Programming | |||
how to exit sub | Excel Programming | |||
Exit when its a Mac | Excel Programming | |||
If a called sub exit, how to the caller exit right away? | Excel Programming |