I have a strange problem after making some COM calls to Office

Basically the call succeeds and does what it should and the rest of the code (making many more calls) in the function continues to run and works fine

However as soon as the DF function finishes it drops to a parent procedure (button OnClick) that has no more code left in it and when that ends the debugger jumps to RemoveObject of a different Button to the one I have just clicked and carries on to exit the application as though I have clicked the close X

No errors. Nada. Nothing in Event Viewer

If I run it outside the debugger it just 'drops out'

If the offending COM calls are not made then the debugger jumps to Notify_Application_Activation instead of RemoveObject

Has anyone else seen this sort of behaviour in their COM interactions

Whilst it is not specific to one call some of the offenders are ComRecipients and ComSendUsingAccount of an appointment item both of which return valid COM object ID's that work


I fully accept it is probably as simple as I am calling them at the wrong time or on the wrong type of appointment but they do return valid handles that I can go on to use but something somewhere is affecting the subsequent DF program flow that make it think it needs to terminate