Registration [Error] xlfRegister call failed for function or command: '_XLogP'

275 views
Skip to first unread message

Jiri Pik

unread,
Mar 5, 2017, 10:08:11 AM3/5/17
to Excel-DNA
What is wrong with this name of an Excel UDF function, please? 

If I call it XLogP, all works well. Is there any workaround to make this work?

The function signature is

public static double XLogP(object input)

Govert van Drimmelen

unread,
Mar 5, 2017, 1:47:47 PM3/5/17
to Excel-DNA
Interesting - I can confirm that the registration call fails for me too.

Note that _xlqqqq also fails, while _X_logP works fine.
I guess the _xl... names are somehow 'reserved' by Excel, but I don't recall seeing anything that documents this.

-Govert

Jiri Pik

unread,
Mar 5, 2017, 3:34:40 PM3/5/17
to Excel-DNA
I think it's something specific to Excel-DNA. The previous version of this function was implemented using Excel Automation (ActiveX / COM) and there it worked. 

The name of the function is bad, for sure, but why would it work using Automation and not via an XLL add-on?

Govert van Drimmelen

unread,
Mar 6, 2017, 6:36:38 AM3/6/17
to exce...@googlegroups.com

Yes, it might well be that this name limitation is specific to C API-based .xll add-ins like Excel-DNA.

 

The name space that .xll add-in registration go to is different to function from VBA or Automation Add-Ins.

If you inspect the .xlsx file, you’ll see all functions from .xlls being stored with the name _xll.MyFunction()

I think automation add-ins get a hidden name that includes the ProgId, though I haven’t checked for a while.

 

I normally advise add-in authors to pick a short prefix that all of their function names share, e.g. you might have =jpXLogP(….) and =jpInfo(…)

You might also have a period in the name, e.g. =jp.XLogP() and =jp.Info().

That makes it really easy to find your functions in the function list while typing in a formula, and helps prevent different add-ins from having the same function names.

 

-Govert

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.

Jiri Pik

unread,
Mar 6, 2017, 6:48:02 AM3/6/17
to Excel-DNA
THANK YOU.
Reply all
Reply to author
Forward
0 new messages