Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think I would put it in this order. that way, if it goes to Jumpexit, it
is unlikelty to run the main code. Sub TLPColl() On error goto Jumpexit workbook.open "XXXX" 'here are my procedure Jumpexit: Msgbox "Kindly mention the path where the raw file is saved in Cell D5 of Summary Tab" Exit sub "Heera" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Exit a Procedure from a Sub within a sub | Excel Discussion (Misc queries) | |||
run procedure when exit design mode | Excel Programming | |||
run procedure when exit design mode | Excel Discussion (Misc queries) | |||
What is procedure to exit formula auditing mode? | Excel Discussion (Misc queries) | |||
Opening a UserForm causes a crash in the Exit procedure (Which is never called) | Excel Programming |