I'm making a code for a 3D Program CATIA and the code runs through all tree with recursive loop. I would like to exit the recursive loop, after it find a specific product. But my code keeps running , even though he found it. I wrote roughly meins. What did I make a mistake in there?
Private Sub TestMain
.....
call TestMainChildren
.....
End Sub
Private Sub TestMainChildren
For Each item In product
.....
If itemName = "SearchName" then
MsgBox("Found!")
Exit Sub
End if
......
Call TestMainChildren
Next
End Sub