View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Heera Heera is offline
external usenet poster
 
Posts: 98
Default Exit sub only and only if there is an error in the procedure.

Hi,

I want a code which will exit the macro(Procedure) only and only if
there an error in the procedure.

Here is the code which i wrote but after the error message it
continues to run the next procedure and i want it to it to exit. If
there is no error it comes on the exit sub and stops the macro.

Sub TLPColl()

On error goto Jumpexit

workbook.open "XXXX"

Jumpexit:
Msgbox "Kindly mention the path where the raw file is saved in Cell D5
of Summary Tab"

Exit sub

'here are my procedure

Exit Sub

Kindly help.

Regards

Heera