Forum Discussion

rishi_1's avatar
rishi_1
Occasional Contributor
13 years ago

How to resolve this error Window was destroyed during method execution'.??

Every time I click on yes button to close a dialog I get 'Window was destroyed during method execution'







The error message is:



The window with the handle 0x00000000 does not exist.

Most likely, this error occurred because the tested object (window or control) or its parent object was deleted or recreated during the method call or before it. For instance, the window could be destroyed or recreated after you stored the object reference to a variable and before you called the object method through this variable.

If the object is recreated, then to avoid the error, check the object's Exists property before calling the method, and if the object does not exist, obtain a reference to the new object.





Please suggest me a generic solution to resolve this error.