View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default How to avoid re-initialisation when Unloading form

Then name of the initialize event should be

Private Sub Userform_Initialize()

so I am not sure what you get wtih MyForm_Initialize

The initialize event shouldn't be fired by an unload command unless the the
form is not loaded. Are you using

Unload Me

--
Regards,
Tom Ogilvy

"count" wrote in message
...
Hi,
It's got to be a newbie question:
I have, for a change, stuff in MyForm_Initialize that can yield an error.
I trap it with On Error GoTo, where Msg explains it to user.
Now, if there's no other statements past Msg, I get to see troubled form
anyway.
If I put Unload Me after Msg then this triggers Initialize and there we go
again with error, trapping of it, Msg etc.
Looping, mind you.
How do you avoid this situation elegantly?
TIA
Paul