If you plan to use C# for your Excel-DNA add-in, one approach to get started is by following the detailed step-by-step instructions (with screenshots) in the Distribution directory. If you're already comfortable with the NuGet package manager, it's even easier
- you just
and follow the Readme instructions that will pop up.
The code in the ExcelRtdServer.dna file (https://exceldna.codeplex.com/SourceControl/latest#Distribution/Samples/RTD/ExcelRtdServer.dna
would be a good start for an RTD server. It shows how to make a ticking RTD server based on
events. Basically you just create a class that derives from
and override the
(and possibly other) methods. Then call
when data changes. Finally set up some wrapper functions that call
to expose to the user.
To integrate the RTD server in a working C# add-in, create a new file and copy the stuff in from the sample. (You probably have to uncomment the
As an alternative RTD implementation, Excel-DNA also supports exposing Rx-style IObservables to Excel as real-time sources. But for this you'd need to be familiar with the Rx library first.
I made the .dna files so that it is easy to create an add-in with some code, and not need to compile a project. That's pretty helpful for making standalone little tests and examples. Excel-DNA also supports using compiled projects, and even having loose .cs
source files that compile at load time. But these need a few files for every example, while a single .dna file is complete. The functionality supported by Excel-DNA is all these cases is exactly the same.
If you have more specific questions, or if you get stuck trying to make any of this work, please write back.