Clear all variables?

Well if all global variables should be reset to get a clean state, I would assume that all windows of the application get closed beforehand.
The best is anyway to get rid of all global variables.

This maybe better, although it requires to go through all windows instances like I do above. This resets all strings to “” on a window. The same could be done with numeric values, but I did not go through the pain of listing all the window default numeric properties such as left and top to exclude them. But the principle seems valid so far :

Dim myProperties() as Introspection.PropertyInfo = Introspection.GetType(self).GetProperties For i as Integer=0 to Ubound(myProperties) if myProperties(i).PropertyType.Fullname = "String" and myProperties(i).Name <> "Title" then myProperties(i).Value(self) = "" end if Next

The advantage is that it does not force the use of global variables in place of the normal window properties.