I have a VB6 OCX control used on MS Access forms. It turned out that raising an event from my ActiveX may slow down code execution dramatically when the control is hosted by an MS Access form. This does not happen in VB6 apps - only in MS Access.

My idea is not to raise the events if they do not have attached event handlers in MS Access VBA code. Is there a way to detect (from inside an ActiveX control) whether an event has an attached event handler?