There are a few samples using F# with Excel-DNA, and I'm happy to help with any questions.
You can start by making an F# Class Library project, then installing the ExcelDna.AddIn package from NuGet and copying in the code from the Readme into your source file.
Then it should compile and run and give you a new UDF in Excel.
Once you have that working, you can look at some of the F# samples you'll find online:
* A nice introduction written by Natallie Baikevich:
http://luajalla.azurewebsites.net/excel-dna-three-stories/
* Quite a big financial library with F# and Excel-DNA from Bram Jochems:
https://github.com/bramjochems/MyExcelLib
* And an F# object handler implementation from David Carlson:
https://github.com/mndrake/ExcelObjectHandler
The Excel-DNA Registration extensions also have some support for the F# async functions and observable events -
https://github.com/Excel-DNA/Registration
The embedding question is a bit harder. Excel-DNA add-ins are native Excel .xll add-ins, so UDFs and macros are global to Excel and not tied to a particular workbook. So although you can embed your add-in into a workbook, the functions won't actually have any relationship with the workbook.
Easiest is just to distribute the .xll file itself. You might add some macros and a ribbon extension to your add-in that creates (or extract from an embedded resource) a template workbook which uses your functions - kind of turning around the relationship between the code and the workbook.
-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.