View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Frederick Chow Frederick Chow is offline
external usenet poster
 
Posts: 75
Default A question on procedures

Hi Niek,

Glad to tell you more detail about this.

ProcParent is a WorkBook_BeforeSave which will call a subroutine, ProcChild,
located in another workbook, whose job is to destroy all codes in the
workbook where ProcParent is located.

So at the time of finishing running ProcChild, the ProcParent will never
exist, and that's why I don't want control to be returned to a non-existent
ProcParent.

Any advise from this?

Frederick Chow
Hong Kong
"Niek Otten" wrote in message
...
Hi Frederick,

Maybe you should tell us a bit more about what you're trying to achieve;
there may be alternatives that are acceptable to you.
Not returning to immediately after the call is generally considered (very)
bad practice and is even impossible in many programming languages.

--
Kind regards,

Niek Otten

"Frederick Chow" wrote in message
...
Hi all,

Suppose I have to subroutines, ProcParent and ProcChild. ProcParent calls
ProcChild. For some reasons, I don't want the control to be passed back
to ProcParent after Executing ProcChild. I have searched through the VBA
help and I found that both END statement and STOP statement placed in the
ProcChild could do the job, but they have side effects: END will reset
any module-level variables, which certainly I don't want, and the STOP
statement will just leave the VB editor in (undesired) break mode. Are
there any other options? Please advise.

Frederick Chow
Hong Kong.