(Solved) – Having a problem with control passing to parent subroutine on error [closed]


I have a subroutine (parent) that calls another subroutine (child). Both have “On Error GoTo ErrorTrap” commands. In the child routine, I am using the error handling primarily because I am adding string text items to a collection and using the same text as the key. I want a collection of unique items (no duplicates) so I am using Error 457 when it tries to add a duplicate, thereby handing control to a Resume Next command. It works great for the first couple of thousand such errors and then it strangely passes control to the parent subroutine. This always happens at the same point, with the same item and it’s still Error 457. It’s like it’s had enough and thinks I’m abusing error 457! Any ideas why this happens, or what I could do to prevent it? Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *