Sorry, somehow the other two screenshots did not come up on the post.
Sounds like you may have the OnLastWindowClose trigger in File Options set to perform a script that no longer exists in your file. Note that this script may exist but have a perform script step set to perform a script that has gone missing.
If all else fails, enable the debugger and close your file to see what triggers get tripped during the file close as there are other triggers that may be tripped in the process of closing the file..
Thanks Phil, that was the problem!