If I understand the requirement correctly then you do not want to display the error window.
What you can do is disable showing the error message as follows
Tools->Options->View->Show Errors. If you uncheck that then when an error comes, it will not show the error so you do not have to click on OK. |