Hi,
I am running code and want call a 'exit' sub when I need to exit the currentely executing code. I pass a message to this 'exit' sub that is displayed before quiting the application. The problem is i dont know how to quit the app, End Sub just ends the 'exit sub and returns me to the main code from which it was called, how do I get it to quit the application?
Eg.
Private Sub Main()
Do some stuff
If something Not Type Of something Then Exit_Sub("A message")
Do some more stuff
If something1 Not Type Of something1 Then Exit_Sub("Another type of message")
And do more stuff
End Sub
Private Sub Exit_Sub(message as String)
Set some variables to Nothing
MsgBox message
Exit Sub 'This just returns me to the main sub, I need to kill the app at this point?
End Sub
Any help appreciated,
Rob
I am running code and want call a 'exit' sub when I need to exit the currentely executing code. I pass a message to this 'exit' sub that is displayed before quiting the application. The problem is i dont know how to quit the app, End Sub just ends the 'exit sub and returns me to the main code from which it was called, how do I get it to quit the application?
Eg.
Private Sub Main()
Do some stuff
If something Not Type Of something Then Exit_Sub("A message")
Do some more stuff
If something1 Not Type Of something1 Then Exit_Sub("Another type of message")
And do more stuff
End Sub
Private Sub Exit_Sub(message as String)
Set some variables to Nothing
MsgBox message
Exit Sub 'This just returns me to the main sub, I need to kill the app at this point?
End Sub
Any help appreciated,
Rob