ExcelDnaDoc.exe Unhandled Exception

86 views
Skip to first unread message

Pa...@MargusConsulting.com

unread,
Sep 27, 2022, 5:42:11 PM9/27/22
to Excel-DNA
Hi Govert --

I ran the following command:

ExcelDnaDoc.exe "Kalends\Kalends-AddIn.dna"

I got the following error message:

Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: assemblyFile

The "HTML Help Workshop" is installed under "C:\Program Files (x86)\HTML Help Workshop".

I'm at my wit's end.  Please help.

Govert van Drimmelen

unread,
Sep 28, 2022, 2:25:14 AM9/28/22
to exce...@googlegroups.com

Hi Paul,

 

I made a small add-in using the ExcelDnaDoc v 1.6.0-RC1 package, and that seems to build and work correctly.

I’m not sure in what context the explicit command would be running, or what version you are using at the moment.

But for me the package works OK.

The error you see referring to an “assemblyFile” parameter doesn’t seem to come from the ExcelDnaDoc code itself, so I’m not sure what it might mean.

 

-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 view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/e1bb8989-9185-458e-9033-7395fac3875cn%40googlegroups.com.

Pa...@MargusConsulting.com

unread,
Sep 28, 2022, 3:31:56 PM9/28/22
to Excel-DNA

Hello, Govert –

 Thanks for your quick reply.  This is an interesting problem.  Here are some additional details.

1.       As suggested in https://github.com/Excel-DNA/ExcelDnaDoc, I downloaded htmlhelp.exe (the "HTML Help Workshop" installation file) from the following site:

https://web.archive.org/web/20200918004813/https://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe

 To install the software, I ran htmlhelp.exe. It stated that it would install version 1.3. 

But it installed version 4.74.8702.0 instead. 

The application, including hhw.exe and numerous other files and subfolders

is located in "C:\Program Files (x86)\HTML Help Workshop".

 2.       Using the NuGet Package Manager, I installed “ExcelDnaDoc v 1.6.0-RC1” in my project.

But I couldn’t find ExcelDnaDoc.exe anywhere on my computer.

 3.       So, I created a small test project: “Class Library (.NET Framework) - A project for creating a C# class library (.dll)”.  Using the NuGet Package Manager, I added the following packages:

  <package id="ExcelDna.AddIn" version="1.6.0-rc1" targetFramework="net48" />

  <package id="ExcelDna.Integration" version="1.6.0-rc1" targetFramework="net48" />

  <package id="ExcelDna.Interop" version="15.0.0" targetFramework="net48" />

  <package id="ExcelDna.Registration" version="1.6.0-rc1" targetFramework="net48" />

  <package id="ExcelDnaDoc" version="1.6.0-rc1" targetFramework="net48" />

  <package id="Microsoft.CSharp" version="4.7.0" targetFramework="net48" />

 Once again, ExcelDnaDoc.exe was nowhere to be found.

 4.       As a last resort, as suggested in 

https://github.com/Excel-DNA/ExcelDnaDoc/blob/master/docs/content/index.md ,

I downloaded the compiled binaries (Excel-DNA-ExcelDnaDoc-4fc9a57.zip)

from https://github.com/mndrake/ExcelDnaDoc/zipball/release.  Then I unzipped it to C:\...\ExcelDnaDoc\ .

 In the Visual Studio “Developer Command Prompt”,

I ran ExcelDnaDoc.exe with its complete path name, first for my VB project, …

C:\...\ExcelDnaDoc\ExcelDnaDoc.exe   "Kalends\Kalends-AddIn.dna"

… and then for my C# test project,

C:\...\ExcelDnaDoc\ExcelDnaDoc.exe   " ClassLibrary3\ClassLibrary3-AddIn.dna"

In both cases, I got the error message:

Unhandled Exception: System.ArgumentNullException: Value cannot be null.

Parameter name: assemblyFile

The "HTML Help Workshop" is installed under "C:\Program Files (x86)\HTML Help Workshop".

 ========

To summarize, the foregoing raises two questions, both related to ExcelDnaDoc.exe:

  •  After “ExcelDnaDoc v 1.6.0-RC1” is installed in both projects (items 2 and 3 above),
why is ExcelDnaDoc.exe always missing?
  •  Is the separately downloaded version of ExcelDnaDoc.exe (item 4 above) somehow defective?

  ========

Sorry for burdening you with this lengthy narrative.  But I hope that it leads to a solution.

Whatever the outcome, I’m very grateful for your help.

 – Paul

Govert van Drimmelen

unread,
Sep 28, 2022, 6:11:29 PM9/28/22
to exce...@googlegroups.com

Hi Paul,

 

When you rebuild now, with the ExcelDnaDoc package referenced, do you get a folder called “HelpContent” in your output directory? Do you get a file called xxx-AddIn.chm?

 

I get these, created by the build tasks in the ExcelDnaDoc poackage.

There is no ExcelDnaDoc.exe shipped with the NuGet package – it just runs as a normal build task from a library assembly.

 

If you clone the ExcelDnaDoc repository and rebuild, you’ll get an ExcelDnaDoc binary being built that should work.

If it does not work you might need to run it under a debugger.

But I suggest just using the NuGet package.

Paul Margus

unread,
Oct 1, 2022, 5:56:05 PM10/1/22
to exce...@googlegroups.com

Hi Govert –

 

Success!  ExcelDnaDoc is working now!

 

As implied in your latest email below (Wednesday, September 28, 2022 18:11), we don’t generally run ExcelDnaDoc.exe in a “Command Prompt” Window.  In fact, it seems that I don’t even have to know that ExcelDnaDoc.exe exists.   As you said, ExcelDnaDoc does all its work during the “Rebuild Solution”.

 

To answer your questions in that Wednesday email, after “Rebuild Solution” …

 

  1. I get the following “HelpContent” folders:

 

    1. Kalends\Kalends\bin\Debug\HelpContent, which “Rebuild Solution” rebuilds. It contains …

                                                               i.      One *.htm help document for each registered function or command.

                                                             ii.      helpstyle.css, which I assume can be modified to taste.

                                                           iii.      Table of Contents.hhc (an html file).

                                                           iv.      Kalends-AddIn.hhp

 

    1. Three Folders containing *.cshtml templates, which “Rebuild Solution” does NOT rebuild:

                                                               i.      Kalends\Kalends\HelpContent

                                                             ii.      Kalends\packages\ExcelDnaDoc.1.6.0-rc1\tools\HelpContent

                                                           iii.      Kalends\packages\ExcelDnaDoc.1.6.0-rc1\content\HelpContent

 

  1. I get one xxx-AddIn.chm file:

 

    1. Kalends\Kalends\bin\Debug\Kalends-AddIn.chm, which “Rebuild Solution” rebuilds.  (The “HTML Help Workshop” can decompile it into *.htm files.)

 

I have a few more questions.  Following is a typical function definition in my VB code:

 

    <ExcelFunctionDoc(

        Category:="Kalends - Date Functions",

        HelpTopic:="Kalends-AddIn.chm!1050",

        Description:="Returns the day of a given Date Serial Number.",

        Returns:="Julian or Gregorian integer Calendar Day",

        Remarks:="<p>K_DAY is a generalization of Excel's built-in DAY function.</p>")>

    Public Function K_DAY(

        <ExcelArgument(Description:="Required.  A Serial Number for the desired date.  A signed integer.  1899-12-30 is zero, and earlier dates are negative.")>

            DateIndex As Integer,

        <ExcelArgument(Description:="Optional. 0 or omitted=Gregorian, 1=Julian, 2=British")>

            Optional WhichCalendar As Integer = 0      ' = EnumWhichCalendar.Gregorian

    ) As Object

 

My “HelpTopic:=” specification names the *.chm file, followed by !nnnn, where nnnn is a 4-digit number.  It appears that I can choose any unique 4-digit integer (1050 in this example), and then ExcelDnaDoc inserts it into the help data file.  

  • I’m guessing that I can choose almost any integer, but that it’s my responsibility to keep them unique, so that no 2 registered functions have the same number.   True?
  • The *.chm file must always be named xxx-AddIn.chm, where xxx is the name of the Project (or Solution?).   True?

 

My “Remarks:= specification contains HTML mark-up.

  • Using <p>…</p>, I can control paragraph breaks.
  • In addition, <table>,  <tbody>, <tr>, and <td> all work as expected.
  • But

<a href="https://support.microsoft.com/en-us/office/date-function-e36c0c8c-4104-49da-ab83-82328b832349">DATE</a>

doesn’t.  Although it creates a nice-looking link in the help, clicking it doesn’t seem to work.

Is this feature intended to be supported?

 

Somewhere, I think that you explained that Excel Spreadsheets don’t understand Enumerations.   Therefore, the above definition contains

Optional WhichCalendar As Integer = 0

rather than

Optional WhichCalendar As EnumWhichCalendar = EnumWhichCalendar.Gregorian

  • That’s something that we always have to live with.   True?

 

Thanks for all your help.  The entire ExcelDna suite is first rate.  You have filled a tremendous void in Visual Studio’s support of Excel.

 

signature -- Paul 005

Paul Margus, FSA, MAAA

https://margusconsulting.com

 

49 Webster Road

PO Box 484

Tyringham, MA 01264

1-413-822-9017

Pa...@MargusConsulting.com

 

This e‑mail and any attachments are solely for the addressee.  The content may be PRIVILEGED, CONFIDENTIAL, PROPRIETARY, and COPYRIGHTED.  Any unauthorized use, dissemination, or copying is prohibited and may be unlawful.  If you are not the intended addressee, please notify the sender immediately and delete this e‑mail, attachments, all copies, and any printout.

--
You received this message because you are subscribed to a topic in the Google Groups "Excel-DNA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/exceldna/Mgg-8cOH7E4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/057401d8d387%243eb1b930%24bc152b90%24%40gmail.com.

image001.jpg

Govert van Drimmelen

unread,
Oct 2, 2022, 3:22:01 PM10/2/22
to exce...@googlegroups.com

Hi Paul,

 

  • I’m guessing that I can choose almost any integer, but that it’s my responsibility to keep them unique, so that no 2 registered functions have the same number.   True?

 

Yes, this is correct.

 

  • The *.chm file must always be named xxx-AddIn.chm, where xxx is the name of the Project (or Solution?).   True?

 

By default he add-in base name and help file name is taken from the project name with “-AddIn” appended.

But you can override this by setting a property in the project file called <ExcelAddInFileName>MyAddInName</ExcelAddInFileName>

 

  • [About <a href=”…”> .. web links] Is this feature intended to be supported?

 

It works for me, - maybe you need extra quotes around the link, or there is some setting that prevents your help viewer from navigating to the web site.

 

  • [About direct support for enums] That’s something that we always have to live with.   True?

 

It depends how you want this to work in Excel. You could set things up so that your function takes a string as input, and interprets that as an enum value when evaluating the function. Javascript add-ins in Excel have some way to define extended “data types” , but this is not available from our .xll add-ins. Maybe Microsoft will allow that some day?

image001.jpg

Paul Margus

unread,
Oct 2, 2022, 5:59:41 PM10/2/22
to exce...@googlegroups.com

Hi Govert –

 

Thanks for the answers.

 

I found that it’s better to insert the attribute target="_blank", as in

<a target="_blank" href="https://support.microsoft.com/en-us/office/datevalue-function-df8b07d4-7761-4a93-bc33-b7471bbff252">DATEVALUE</a> function.</p>")>

(Because Remarks:="" is a VB string each double-quote must be repeated as in target=""_blank"".)

Without this attribute, it attempts to open the website in the Help Window and displays a Scripting Error.

 

I made another discovery:  The Category:="" attribute must not contain a colon (:). 

Therefore,

  • Category:="Kalends - Date" is OK, but
  • Category:="Kalends: Date" is not.

If you include a colon, the Build fails with the following message:

The "CreateDocumentation" task returned false but did not log an error.

Not very helpful.

 

Anyway, thanks again.

 3.       So, I created a small test project: “Class Library (NET Framework) - A project for creating a C# class library (.dll)”  Using the NuGet Package Manager, I added the following packages:

image001.jpg
Reply all
Reply to author
Forward
0 new messages