I have written a small com-type macro that works with Solid Edge. Occasionally it will crash with a "Call was rejected by callee" error. Unfortunately that error never crops up when I run it in the Visual Studio environment -- only with the compiled version. So I cannot trace back to the line that the error occurs at. From what I can gather, it is called by Solid Edge being too busy at the time. Is there an easy work-around to eliminate this issue?
We've covered the topic extensively in the Solid Edge ST7 SDK - Handling 'Application is Busy' and 'Call was Rejected By Callee' errors
DoIdle() can help avoid rejected calls but implementing an OleMessageFilter is the only way to handle the types of exceptions mentioned in the OP. There are lots of reasons that RPC_E_CALL_REJECTED can be thrown by a COM server and it's not always in your control.