[Compiled .xll shows error] vs [Normal .xll beside .dna works fine]

Mar 19, 2014 at 1:29 AM
Edited Mar 19, 2014 at 1:32 AM
Hi Govert,

The Excel community can't thank you enough for this great product you've developed!

I have a strange behavior though:
the normal .xll works without problem beside the .dna file and also a .dll file. So in total 3 files in the same folder;
if I compile the 3 files with the ExcelDnaPack.exe file, it gives me a success message;
But the final .xll (moved to a different folder) shows an error that I can't understand while the normal .xll works fine!
What am I doing wrong?

I've put the project (it is a dummy project with 1 subroutine, one ribbon tab, one group and one HappyFace button) and screenshots of the errors at:
https://www.dropbox.com/sh/qr9stp46r8f6qd0/QcjJSiptvP

Gr,
Raymond
Coordinator
Mar 19, 2014 at 9:51 AM
Hi Raymond,

From the ExcelDnaPack output, I see that your .dll file is not being packed.

Is your compiled DummyAddIn.dll a file that would include functions and macros that are to be exported to Excel? If so, then you do need to <ExternalLibrary Paty="..." Pack="true" />part in the .dna file, which is currently commented out in the version in bin\Debug\DummyAddInDna.

If you mean for DummyAddIn.dll to be available only from the code that is inside the .dna file, then you need to have a
<Reference Path=".." Pack="true"/>` tag instead.

In any case, you can examine the ExcelDnaPack output to see what is packed.

These days I recommend using the "Excel-DNA" NuGet package to start a new project, if you're using Visual Studio. That sets everything up correctly. For this:
  • Create a new Visual Basic "Class Library" project.
  • Open the "Package Manager Console" from the "Tools->Library Manager" menu.
  • Enter "Install-Package Excel-DNA -Pre" (the -Pre means that pre-release versions are installed too, so you'll get the new Excel-DNA v 0.32 test version).
  • Then put some code into the Class1.vb file and press F5 to run.
  • Building also makes a packed add-in file that you can rename and distribute.
-Govert
Mar 19, 2014 at 1:12 PM
Hi Govert,

Thanks for the quick response!

It's now working :-)
That NuGet stuff is great. The .xll is automatically created when you build. Awesome!
Again, thanks a lot.

Gr,
Raymond