I've written a COM automation server for excel that works as expected but sometimes gets restarted by excel. Does anyone know why this is, what's the best way to handle this and if there is anything I can do to prevent this?
It's an RTDServer. As stated in the documentation, the ServerTerminate
interface should only be called by the host (Excel) in one of the following scenarios:
- The server didn't start correctly (and therefore didn't return
- All rtd's on a sheet have been deleted and thus the server no longer has context
http://msdn.microsoft.com/en-us/library/office/aa140060%28v=office.10%29.aspx
However, ServerTerminate
does in fact get called when neither of the above conditions are met, which in combination with this leads me to believe that something else is going on. It also leads me to believe that the particular type of automation server (rtd) used is irrelevant as this could be a COM automation issue rather that one that is ties to a specific interface.