'What is an efficient way to connect Excel to ML.NET?

Ultimately I would like to generate ML.NET code that can be consumed by Excel. I would generally assume that creating a DLL would be the most appropriate way. Having an Excel VBA wrapper around it would then allow non-programmers to utilize it via "=" cell functions. I am rather surprised that Microsoft has not supplied that yet, but I am not finding anything along those lines.

I found a rather extensive approach here. I would prefer something simpler if possible, but am willing to do that, if that is what it takes:

How to call C functions from Excel using a DLL written in C (or C++)

I have also found references to Excel-DNA in this Q&A:

Creating add-in for Excel using C#

Any incremental pointers towards that goal would be appreciated.



Solution 1:[1]

I dont see a way to do that, since ML.Net uses clr-Host. That means that Excel would have to start the clr runtime. Excel allows to import statically linked c++ and c compiled Functions, since they dont require a runtime and are compiled to machine code.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bernhard Grimm