Using Notes.NotesUIWorkspace from VB with R8

I have an application that creates an Appointment insode my Notes calendar. This works fine if Notes is already running (and works OK in R6.5 and R7 regardless) but if Notes has to be opened, it gives me the error message “ID is in use and cannot be modified” at the point in VB where it creates the Notes.NotesUIWorkspace object.

This is definitely a timing issue, because if I force the VB code to sleep for 10 seconds, it works OK.

Question - can anyone tell me please what logic I can use to check that the uiWorkspace object is ready to be used? Are there any attributes I can read, or something like that?

Thanks for any help.