Excel DNA Packaging/Redistributing Error - External Libraries could not be registered

111 views
Skip to first unread message

Bilal Saleem

unread,
Jan 22, 2019, 4:59:18 PM1/22/19
to Excel-DNA
Hello,
I've developed an Excel Library using Excel DNA. It's working fine if I just directly add the AddIn to Excel from Debug folder.
For redistribution in a single .xll file, I've used Excel DNA Pack.exe, added all the References in a .dna file.

<DnaLibrary Name="Riskwatch addin Add-In" RuntimeVersion="v4.0">
  <ExternalLibrary Path="Riskwatch addin.dll" ExplicitExports="false" LoadFromBytes="true" Pack="true" />
  <Reference Path="alglibnet2.dll" Pack="true" />
  <Reference Path="ExcelDna.IntelliSense.dll" Pack="true" />
  <Reference Path="MathNet.Numerics.dll" Pack="true" />

</DnaLibrary>


Capture.PNG

After running the command to pack everything (>ExcelDnaPack.exe "Riskwatch addin-AddIn.dna" /O Lib.xll /Y), it successfully creates the single .xll file.


Adding AddIn in Excel, gives me error: 

Initialization [Error] External library could not be registered - Path: packed:RISKWATCH ADDIN : ArgumentOutOfRangeException - Unknown resource type. Only types 0 (Assembly), 1 (Dna file), 2 (Image) or 3 (Source) are valid.
Parameter name: type

Initialization [Error] External library could not be registered - Path: packed:RISKWATCH ADDIN : ArgumentOutOfRangeException - Unknown resource type. Only types 0 (Assembly), 1 (Dna file), 2 (Image) or 3 (Source) are valid.
Parameter name: type


Please give me any suggestion, clue. Am I missing something???

Govert van Drimmelen

unread,
Jan 22, 2019, 5:42:05 PM1/22/19
to Excel-DNA
Hi Bilal,

This seems to be the same message that appears in this question: https://groups.google.com/forum/#!topic/exceldna/FMHmsXObWs8

I don't know why this would happen - the only thing that looks strange about your add-in is the space in the name.
I wonder if that might have anything to do with the error (it shouldn't - if so it would certainly be a bug).

Would it be possible for you to copy everything into a new project with a name that has no space, and check if that fixes the problem?

-Govert

Govert van Drimmelen

unread,
Jan 23, 2019, 1:47:54 AM1/23/19
to exce...@googlegroups.com
Hi Bilal,

Can you show the full output of running Excel-DNA know?

-Govert

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages