I think it's because in WME code there is called sequence like this (eg. in Object Pascal):procedure
so when you close the OpenDialog window (by pressing CLOSE button), the variable Window.Name can't be set, because OpenDialog.FileName is not set and throws the error.
It can be avoided by using something like this:if
this code controls, if in OpenDialog was opened some file, else the code inside is not launched.
I think that Mnemonic just overlook this