Creating Functions/Subroutines inside Invoke Code



I was wondering if it was possible to create custom functions or subroutines from within the Invoke Code activity?
I know that custom functions and subroutines are possible using VB.Net but I seem to keep getting error while attempting to implement the way they use inside Invoke Code.
The main errors are:
“Statement cannot appear from within a method body”
“End Sub must be preceded by a matching Sub”
I’ve read the articles about how to use Invoke Code, but I can’t seem to find a way to do this.



you should check this Invoke code activity VB.Net example