What I’m trying to achieve is to close any open dialogs on the screen during the process. Should the robot encounter an issue, I want to close all the open dialogs and start again from fresh. The problem being I cannot know for sure what dialogs are left open. So I want close any open, leaving the main application running.
I was trying something like:
For each myForm as Form in My.Application.OpenForms
But the Invoke code does not like this. Anybody have an suggestions?