Just check your conditions and use Activity.Finish inside your sub... You dont need to "get" the "sub" Activity.Finish as parameter to this sub... That´s totally needless and you make it just more complicated than it should be!
You should have explained more details of the situation.
WE dont know that it is a code-module. So we are thinking about the same activity..
We dont get infos about any error you got.
@DonManfred Well, I did start by saying "... we can have shared code libraries ..." so it is assumed I'm referring to a problem in relation to that, or else that sentence would be irrelevant noise. Agreed about not mentioning the actual error, though. Thanks.