Exception Handler Problem

I have a 'try...except' handler in which I am trying to close the host form in the except section. The excetion handler is in the 'on activate' procedure of the app. When the exception tries to run I get an error 'invalid function or procedure call' if I put form1.close in the except section.
I'm sure that this can be easily done but (with my limited experience) I can't work out how.
Any help would be gratefully accepted.