Hi Wenhao,
You don’t have to look at the decompiled code – the Excel-DNA project is open source and here on GitHub: Excel-DNA/ExcelDna: Excel-DNA - Free and easy .NET for Excel. This repository contains the core Excel-DNA library. (github.com)
The 10,000 function limitation is built into the native part of the library, so not easy to change for the user. But it is not an Excel limitation, even though registering a large number of functions in Excel can become slow.
The plumbing in Excel-DNA that links the managed .NET function to native code does not currently support changing or overwriting the link between the registered function and the native export. So additional registrations are always added to the end, and if you keep calling the registration you will eventually run out of slots.
If you are planning to re-register functions in your add-in, for example based on a web service, then I suggest adding some tracking inside your add-in of what functions you have registered, and not registering the same functions again.
Alternatively, you can make a design where you load a new add-in when the registrations have to be re-done. But unloading and reloading of add-ins can also be problematic, and unloading is not supported under .NET 6, so that might not be a perfect solution for you either.
-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 view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/eb8fa093-6188-4000-93ae-b9a6af3bbe50n%40googlegroups.com.