View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default question about exiting a procedure

Make those two subs functions and pass a return code back indicating success
or not

If Sub1 Then
If Sub2 Then
'all okay
Else
MsgBox "Sub2 failed"
End If
Else
MsgBox "Sub 1 failed"
End If

Why are you using Application.Run, this is only required if they are in
another project.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...

let's say i have a form with a command button
when clicked it runs a procedure in one module
when that's done it runs a second one

Private Sub CommandButton1_Click()
Application.Run ("1st sub")
Application.Run ("2nd sub")
end sub


if there is an error at a particular place in the 1st sub, i want to exit

and
make sure the 2nd sub doesn't run

how do i do that? exit sub exits the 1st one and then the 2nd one runs


--


Gary