Hi, first time user, I just pulled the source down and built it, then have built a simple HelloWorld app. I've basically replicated the steps from the nuget package, but using only binaries that I built myself.
- Added a reference to ExcelDna.Integration.dll
- Added a post-build event command-line to copy <package>\tools\ExcelDna\ExcelDna.xll to your output directory as
<ProjectName>-AddIn.xll. This is the add-in loader for your Excel add-in.
- Another command is also added to run the Excel-DNA packing tool ExcelDnaPack.exe to create a single-file
redistributable, called <ProjectName>-AddIn-packed.xll.
- Added a file called <ProjectName>-AddIn.dna to your project, set to be copied to the output directory (same name
as the .xll). This is the configuration file for your Excel add-in.
- Configured <ProjectName>-Addin.dna to load your project library as an add-in library, and pack the compiled library
into the redistributable.
- Configured debugging to start Excel and load the <ProjectName>-AddIn.xll.
I then inserted a sample function.
Everything works fine, except that the call to ExcelDnaPack.exe fails, but only when it's run in the Post-Build event - it succeeds if I run from a command prompt, but not if it runs from the post-build event. I get the following error:
" exited with code -532459699
Hi, I found the problem, I was doing a Debug build of ExcelDnaPack.exe and that has a Console.ReadKey call in a #if DEBUG section - built as Release, everything works fine now.
The moral of the story - build ExcelDnaPack.exe as a Release build if you plan to run it in a post-build event...