Calling RegisterXLL

Add-in Express™ Support Service
That's what is more important than anything else

Calling RegisterXLL
RegisterXLL crashing or having no effect 
Mark K

Posts: 85
Joined: 2007-05-29
Exporting the function means Excel will invoke it. And Excel invokes it when you call RegisterXLL. I suppose Excel expects to receive OPER12 type structures but your XLL add-in returns OPER4 structures. To understand the real cause, you need to debug the functions that your XLL provides. All this closely relates to the things described in the Excel 2007 SDK.

There are multiple functions exported from an XLL. The first one to be called is xlAutoOpen of which there is no XLOPER12 variant. xlAutoRegister12 or xlAutoRegister are not called until after xlAutoOpen. xlAutoRegister12 will be called in preference to xlAutoRegister if is exported and you are runnign Excel 2007 or higher but neither will be called until after xlAutoOpen.

I have placed both debug code and trace points in xlAutoOpen and it is not called when the RegisterXLL fails in the ADX COM DLL. It is called if the xlAutoRegister12 function is not exported. In this case xlAutoRegister is called after xlAutoOpen is called.

My XLL returns an XLOPER4 structure from xlAutoRegister but it returns an XLOPER12 structure from xlAutoRegister12. In any case xlAutoRegister12 is not called because the RegisterXLL call fails so it would not appear to be having a problem with any call to xlAutoRegister12.

I will see if I can find another way to track the error occurring in the RegisterXLL function.

Posted 20 Mar, 2012 07:47:08 Top
Andrei Smolin

Add-in Express team

Posts: 14374
Joined: 2006-05-11

Thank you for the explanation.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 20 Mar, 2012 07:52:14 Top