Difference between NuGet vs Imported Excel-DNA XLL file to Create Project

67 views
Skip to first unread message

Ptownbro

unread,
May 20, 2023, 2:41:51 PM5/20/23
to Excel-DNA
I recently watched Govert's YouTube video on "Excel-DNA in Perspective" and I'm trying to understand the difference in how he created the add-in project in that video versus how it was explained in the instructions he recommended on the Excel-DNA website on the introduction page at this link.

In the instructions at the link, it basically explained two methods:

1) Create an add-in by placing your code in a text-based file with the "*.dna" extension (a DNA file) and combining it with one of the Excel-DNA XLL files.

2) Create an add-in using Visual Studio and then import one of the Excel-DNA XLL files,   place your code in various .NET forms, class, modules, etc.. that is compiled to a DLL file, and last create a text-based file with the "*.dna" extension that points to that DLL file. 

However, in the video he created the project in Visual Studio and then used NuGet manager to setup the add-in. It didn't use one of the Excel-DNA XLL file as far as I could see. It also had a few other slight differences as well (e.g. didn't set the DNA file "Copy to Output Direct" property to "Copy always" or "Copy if newer").

Why the difference?
Which approach is better/recommended?
What happened to the Excel-DNA XLL file in the NuGet method?
So many questions =) 

Really just trying to understand why the different approach and which one is recommend or the most recent approach (maybe the instructions at the link are old??).

Thanks!

Govert van Drimmelen

unread,
May 20, 2023, 3:10:52 PM5/20/23
to Excel-DNA
A good start today would be the Getting Started instructions on the Excel-DNA home page: Free and easy .NET for Excel | Excel-DNA

* Make a new Class Library project in Visual Studio.
* You need to decide whether to use .NET Framework or .NET 6 - this is set in your project file as either

    <TargetFramework>net472</TargetFramework>

or

    <TargetFramework>net6.0-windows</TargetFramework>


Then install the ExcelDna.AddIn package from NuGet. I recommend the latest Excel-DNA pre-release version 1.7.0-rc4 - that's very close to what the next release will be.

With this approach using the NuGet package, the .dna file is created automatically when you build, the .xll files you need com from the NuGet package, and the debugging will be set up automatically.
So it should be easier to get started then in the past.

The documentation is fragmented as things have accumulated and changed over the 18 years of the project.
But I'm more than happy to help you get started using Excel-DNA - if you run into any problems or questions, please write back.

-Govert



Ptownbro

unread,
May 22, 2023, 4:17:49 PM5/22/23
to Excel-DNA
Ok thank you. Based on your input, I take it that the NuGet manager approach is the current and recommended method to use. Thank you!
Reply all
Reply to author
Forward
0 new messages