How to excecute the progrmme in between the for each loop

I want to execute the programme in between the for each loop but iam not able to execute’
it gives error as object reference is not set for an instance

i have to restart the programme form the beginning, it which is time consuming

plz reply

@T_Y_Raju What is the Program that you want to Execute in between the For Each Loop, Can you please explain a bit more as to what you want to do?

like iam executing iam getting text value for web application writing the same in pdf

but when error comes in some activity. And if i correct that activity and re run the same activity ,it says object reference is not set for an instance

then i have to execute whole process from the begining…like log into the web application.