Introduction
Excel-DNA is an independent project to integrate .NET into Excel. I hope it will be useful to Excel users who currently write VBA code for functions and macros, and would like to start using .NET. Also interested would be C/C++ based .xll add-in developers who want to use the .NET framework to develop their add-ins.The Excel-DNA Runtime is free for all use, and distributed under a permissive open-source license that also allows commercial use.
Excel-DNA is developed using .NET, and users have to install the freely available .NET Framework runtime. The integration is by an Excel Add-In (.xll) that exposes .NET code to Excel. The user code can be in text-based (.dna) script files (C#, Visual Basic or F#), or compiled .NET libraries (.dll). Excel-DNA supports both the .NET runtime version 2.0 (which is used by .NET versions 2.0, 3.0 and 3.5) and version 4. Add-ins can target either version of the runtime, and concurrent loading of both runtime versions into an Excel instance is supported.
Excel versions '97 through 2010 can be targeted with a single add-in. Advanced Excel features are supported, including multi-threaded recalculation (Excel 2007 and later), registration-free RTD servers (Excel 2002 and later) and customized Ribbon interfaces (Excel 2007 and 2010). Most managed UDF assemblies developed for Excel Services can be exposed to the Excel client with no modification.
There is newly introduced support for integrated Custom Task Panes (Excel 2007 and later), offloading UDF computations to a Windows HPC cluster from Excel 2010, and for the 64-bit version of Excel 2010 in the latest release - Excel-DNA version 0.29.
Important Links
The new home for Excel-DNA is at http://www.excel-dna.net.The documentation is still sparse, but if you need any help, try the main Excel-DNA support forum on Google Groups, http://groups.google.com/group/exceldna, where an extensive history of discussions can found and searched through.
You are also welcome to contact me (Govert) directly at govert@icon.co.za with questions, comments or suggestions.
Getting Started
Download the latest release, and work through the Getting Started page.And view some additional pointers, including a step-by-step guide to making your first C# add-in, on the work-in-progress Documentation page.
External Links
If you are a VBA developer interesting in moving to .NET, you should start with Patrick O'Beirne's detailed VBA to Excel-DNA migration guide.Next, check out the brilliant step-by-step tutorial series by Ross McLean:
- Excel development beyond VBA
- Why Excel-DNA?
- How does Excel-DNA work?
- Excel-DNA Hello World function
- Writing an Excel-DNA function using an IDE
- Excel-DNA and the Excel object model
As a comprehensive example using many of the Excel-DNA features, be inspired by the Financial Analytics Suite (FinAnSu), an open-source C# add-in built by Bryan McKelvey.
Or browse through the variety of samples and tutorials elsewhere:
- Simon Murphy - xlls with Excel-DNA
- Ed Parcell - Numerical analysis in Excel using C# with Excel-DNA and AlgLib
- Mathias Brandewinder - Mutant Excel with .NET and Excel-DNA
- Mathias Brandewinder - Supercharge Excel functions with Excel-DNA and .NET parallelism
- Mike Woodhouse - A third way: DNA?
- Patrick O'Beirne - From VBA to VB.NET using Excel-DNA
- Doctor Torsten - Bring Excel 2010 to Speed: Remote UDFs with Excel 2010 and HPC Server 2008 R2
- Luca Bolognese - A trading/portfolio management Excel Add-in based on the books by Ralph Vince
- Supermab's series of blog posts introducing Excel-DNA to Japan (in Japanese)
- Joao Morais - WCF client sample
- Chris Spicer - Excel-DNA function list
- teramonagi - Using R from Excel using Excel-DNA (Also check out the F# R type provider.)
Projects using Excel-DNA
- Dodoni.net is a free/open-source library for quantitative finance and numerical computing.
- EQ Finance - Analytics library for derivatives pricing and risk management
- Technoscience UK has some interesting add-ins to mirror Excel data between PCs.
- Niels Bosma - SEOTools add-in (free, but not open source)
- DC Storm made a little wrapper add-in for the .NET UrlEncode and UrlDecode functions
- compute!box! allows real-time interchange of data between spreadsheets (via Azure Service Bus).
And if you get stuck or have any questions, don't hesitate to ask on http://groups.google.com/group/exceldna.
Related Projects
- NetOffice is a set of version-independent assemblies to allow Office integration through the COM automation interface. The NetOffice libraries can be used from an Excel-DNA add-in to ease version-independent Excel add-in development, and ease compatibility with VBA.
- Visual Studio Tools for Office (VSTO) is Microsoft's preferred plan for integrating .NET with Office. It is mainly aimed at making it easy for Visual Studio developers to create solutions integrated with the Office applications. In contrast, Excel-DNA is (eventually) aimed at Excel end-users, as a compelling replacement for VBA, completely independent of Visual Studio.
- Add-in Express is a commercial alternative to VSTO for users with Visual Studio. It support making add-ins for the various Office products, not just Excel, and has helpful wizards and graphics designers.
- Jens Thiel's ManagedXll is an established, commercial product to easily create .xll libraries in .NET. If ManagedXll were free, Excel-DNA would not exist.
- For making Excel Add-Ins in Python, have a look at PyXLL.
- There are a number of C/C++ libraries and tools that make creating .xlls easier than using the Excel SDK directly:
- I initially used the XLW open-source library.
- The XLL+ toolkit is a highly regarded commercial option.
- Keith Lewis has some modern C++ libraries for making .xlls, available on CodePlex at http://xll.codeplex.com/.
Performance
Information about the performance of Excel-DNA user-defined functions can be found on the ExcelDna Performance page.Formal Support Agreements
Corporate users of Excel-DNA, using the library as part of their mission critical infrastructure, may be interested in a more formal support arrangement. I offer an annual subscription-based technical support agreement to such companies. For more details, please contact me by email at govert@icon.co.za.Donations
Financial support for the Excel-DNA project encourages future development and is greatly appreciated. Transactions are processed by PayPal.