packing the components into one .XLL (mylib.dll?)

261 views
Skip to first unread message

Logan Grim

unread,
Nov 18, 2013, 4:36:56 PM11/18/13
to exce...@googlegroups.com
Hi all,

I am trying to package up my addin using the tool provided in the distribution however I do not understand where the Mylib.dll file is supposed to come from. Reading patricks o'beirne's document and to me it looks like this is supposed to be the references that used in the dll (excelDna.integration.dll maybe).

When I put the three files I think I need

myaddin.dll
myaddin.dna
myaddin.xll

and run the packer the packer crashes

am I missing something here? Is visual studio supposed to create an additional dll library?




Govert van Drimmelen

unread,
Nov 18, 2013, 4:45:10 PM11/18/13
to exce...@googlegroups.com
Hi Logan,

The .dna file specifies which files are to be packed. In your case, it seems like you add-in code is in myaddin.dll, so your myaddin.dna would look like this:

<DnaLibrary Name="My Cool AddIn" RuntimeVersion="v4.0" >
    <ExternalLibrary Path="myaddin.dll" Pack="true" />
</DnaLibrary>


Then you run it as "ExcelDnaPack myaddin.dna" and look at the results.

I guess in Patrick's example, his .NET assembly was called Mylib.dll instead of myaddin.dll.

Regards,
Govert

Logan Grim

unread,
Nov 19, 2013, 12:53:51 PM11/19/13
to exce...@googlegroups.com
Hi Govert,

Thanks for getting back to me on this. 
When I do that the packer crashes

I have some XML to customise the ribbon so this is what I have in the dna file

<DnaLibrary Language="VB" Name="Steam Tables Add-in" RuntimeVersion="v4.0">
  
  <CustomUI>
    <!--Note the <CustomUI> with a capital ‘C’ tag that encloses the 
<customUI> 
 with a small ‘c’ tag that saved in the .xll. -->
      <ribbon startFromScratch="false">
        <tabs >
          <tab id="Engineering"
            insertBeforeMso="TabInsert"
            label="Engineering">
            <group
              id="Unitsgroup"
              label="Units of Measure">
              <button
                id="Unitsbutton"
                tag="Units"
                imageMso="TableDesign"
                label="Units"
                screentip="Set the units of measure for the workbook"
                size="large"
                onAction="Units_of_Measure_Form_Call"/>
            </group >
          </tab >
        </tabs >
      </ribbon>
    </customUI>
  </CustomUI>
  <ExternalLibrary Path="myaddin.dll" Pack="true"/>
</DnaLibrary>


I believe that this is correct but with this it crashes

Govert van Drimmelen

unread,
Nov 19, 2013, 1:03:54 PM11/19/13
to exce...@googlegroups.com
Hi Logan,

That looks fine.

So you have the three files in one directory, and the unpacked add-in works correctly?

What is the output of running ExcelDnaPack?

-Govert

Logan Grim

unread,
Nov 19, 2013, 1:54:51 PM11/19/13
to exce...@googlegroups.com
Hi Govert,

I have all three files in one directory and as far as I can tell it works fine when unpacked. I am getting a 

"A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in Microsoft.VisualBasic.dll"

in visual studio as I debug but it doesn't seem to impact anything on the UDFs that I have made.

When I run the ExcelDnaPack I get the windows error 
"ExcelDnaPack has stopped working" 
"Windows is searching for a solution to the problem..."

There is no output file.
I also redownloaded the 0.30 distribution file just in case my packer had gotten corrupted

Govert van Drimmelen

unread,
Nov 19, 2013, 2:09:16 PM11/19/13
to exce...@googlegroups.com
Hi Logan,

ExcelDnaPack.exe needs to be next to a copy of ExcelDna.Integration.dll (it depends on ExcelDna.Integration.dll even though your add-in doesn't).

You'll see a more sensible message if you run it from the command-line:

Run it as something like:

C:\Stuff\ExcelDna\Distribution>  ExcelDnaPack C:\Projects\MyAddIn\bin\Debug\Myaddin.dna

Then if you get an error you should see a more useful message in the console window.

-Govert

Logan Grim

unread,
Nov 19, 2013, 3:24:36 PM11/19/13
to exce...@googlegroups.com
Hi Govert,

The program seems to run (either from the cmd or a straight double click) however the command prompt instantly appears the disappears before I can read what it says. I did a quick screen dump while I was executing and got what appears to be a standard set of instructions on use

I am sure i fully understand what you are saying with the cmd

I tried

start C:\Users\Logan\Desktop\Build1\ExcelDnaPack.exe

and 

start C:\Users\Logan\Desktop\Build1> ExcelDnaPack C:\Users\Logan\Desktop\Build1\Myaddin.Dna

neither of these seem to work for me

Logan
screendump.png

Govert van Drimmelen

unread,
Nov 19, 2013, 3:33:12 PM11/19/13
to exce...@googlegroups.com
HI Logan,

ExcelDnaPack is a console program.

From a command prompt, cd into the directory where the ExcelDnaPack.exe lives.
Then in that directory, type in:

    ExcelDnaPack c:\Projects\Myaddin\bin\debug\Myaddin.dna

(don't put "Start ..." or anything)

where the path to the .dna file is replaced by whatever the path is to your output files.
(I guess you need quotes around the path if there are spaces)

-Govert

Logan Grim

unread,
Nov 19, 2013, 4:32:21 PM11/19/13
to exce...@googlegroups.com
Govert,

Thank you very much it works perfectly. I have not run stuff from the cmd before and I didn't realize that's what I needed to do.
Reply all
Reply to author
Forward
0 new messages