Its this window that I want to close through code
Not sure it is possible to do that with events...
Here is a link to the events that can be used (look at the buttom of the page).
But I would instead try to hide the command from the menu. Below is a link to the method. I would play around with it and see if the method can hide the command and then check to see if the Solidworks register changes. In best case, you might be able to just make a change in the register for all users.
Retrieving data ...