Unhandled exception when opening Excel after upgrading to rev 1.7.0-rc9

177 views
Skip to first unread message

Guido De Bouver

unread,
Oct 30, 2023, 11:02:00 AM10/30/23
to Excel-DNA
dear ExcelDNA lovers,

I recompiled my excel addin today with 1.7.0-rc9 and run into a problem when opening Excel when it is referenced. The error says

"...Unhandled exception has occured in a component....
Method not found: 'Int32 Excel.Dna.Integration.XlCall.PenHelper(Int32,FmlaInfo ByRef)'

I didnt have this when using a prior version - think I was using 1.7.0-rc5 ( even though I am not sure on this previous version ).

Any ideas ?

thank you

Govert van Drimmelen

unread,
Oct 30, 2023, 11:10:29 AM10/30/23
to exce...@googlegroups.com

Hi Guido,

 

You might have an old copy of ExcelDna.Integration.dll in the output directory.

If everything works right, this file should not be in the output directory.

 

The error comes from a new method added to support the IntelliSense.

The error indicates that you have a new IntelliSense version running, but it’s not loading the matching new ExcelDna.Integration.dll version

(which should be loaded from inside the .xll file.)

 

-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/cf8b3606-55fd-4355-ad35-969d2a1b0164n%40googlegroups.com.

De Bouver, Guido

unread,
Oct 30, 2023, 11:28:26 AM10/30/23
to exce...@googlegroups.com

Thank you for your prompt reply

 

I am still using the ExcelDnaPack utility to create the xll based on a DNA config

Inside the DNA file, I am adding the Intellisense.dll and Registration.dll as an ExternalLibrary, not the Integration.dll

 

Howerever, my exceldnapack is version 1.6.1.8 and my baseline xll is dated february 2023.

Is there a later version of those ?

Where to find the latest exceldnapack.exe – it might be good to distribute with the nuget >

 

Thanks for your always-fast-and-accurate help

 

guido



Disclaimer

This email communication is CONFIDENTIAL. If you are not the intended recipient, you may not use, copy or disclose to anyone the message or any information contained in the message and I ask that you please notify me by return email and delete this communication immediately. Thank you.

Govert van Drimmelen

unread,
Oct 30, 2023, 11:30:28 AM10/30/23
to exce...@googlegroups.com

You should not need the ExcelDnaPack utility anymore.

The packed file is created during the normal build using a build task now.

Having a .dna file is still supported, and should work as before.

 

-Govert

De Bouver, Guido

unread,
Oct 30, 2023, 11:44:18 AM10/30/23
to exce...@googlegroups.com

All of my engineers still have the old scheme where I compile all of my code into a dll file and then pack together with ExcelDnaPack

Is it really necessary to go the new way or can the old way be kept ? If so, where could I find the latest exceldnapack.exe and reference xll ?

Thnaks again – and congrats with South Africa winning the rugby world champiopnship 😊

Govert van Drimmelen

unread,
Oct 30, 2023, 3:07:49 PM10/30/23
to exce...@googlegroups.com

Hi Guido,

 

There are no published binaries for the 1.7.0-rc9 version, but I’ll try to remember for the release.

 

Can I try to help you update to using the NuGet package?

I’d also recommend moving to an SDK-style project file if you haven’t yet.

 

For an old-style project, you should be able to just delete the post-build step that ran ExcelDnaPack.

The packing runs as part of the build now.

 

Moving to an SDK-style project file can be a bit of work, but cleans up things and has better support from Visual Studio these days.

You might start with a very clean project file, then add packages and other options until it compiles again.

 

<Project Sdk="Microsoft.NET.Sdk">

 

  <PropertyGroup>

    <TargetFramework>net472</TargetFramework>

  </PropertyGroup>

 

  <ItemGroup>

    <PackageReference Include="ExcelDna.AddIn" Version="1.7.0-rc9" />

  </ItemGroup>

 

</Project>

De Bouver, Guido

unread,
Oct 31, 2023, 3:05:52 AM10/31/23
to exce...@googlegroups.com

We will move to the new standard 😊

Thanks for your much appreciated help

De Bouver, Guido

unread,
Oct 31, 2023, 3:52:02 AM10/31/23
to exce...@googlegroups.com

Govert,

I was using the intellisense reference before. Is that still necessary and if so, do I need to reference it additionally ?

 

    Public Sub AutoOpen() Implements IExcelAddIn.AutoOpen

        ...

        IntelliSense.IntelliSenseServer.Install()

    End Sub

Govert van Drimmelen

unread,
Oct 31, 2023, 4:12:38 AM10/31/23
to exce...@googlegroups.com

Hi Guido,

 

Yes – you need to reference the IntelliSense package like this in the .vbproj file.

    <PackageReference Include="ExcelDna.AddIn" Version="1.7.0-rc9" />

    <PackageReference Include="ExcelDna.IntelliSense" Version="1.7.0-rc9" />

 

If you still have the .dna file in your project, there is probably a line in the .dna file like this:

<Reference Path="ExcelDna.IntelliSense.dll" Pack="true" />

That will still work to include it in the packed .xll.

 

 

For someone without a loose .dna file in the project, the story is like this for the packing.

  • If you’re targeting .NET Framework 4.x, you need to add files to be packed into the .csproj file like this:

    <ExcelAddInInclude>ExcelDna.IntelliSense.dll</ExcelAddInInclude>

  • This can be a semi-colon separated list with other files.
  • You can generate the list from all the .dll files in the output directory like this:

 

  <Target Name="PackedReferences" AfterTargets="AfterBuild" BeforeTargets="ExcelDnaBuild">

    <ItemGroup>

      <References Include="$(OutDir)*.dll" Exclude="$(OutDir)$(TargetFileName)"/>

    </ItemGroup>

 

    <PropertyGroup>

      <ExcelAddInInclude>@(References)</ExcelAddInInclude>

    </PropertyGroup>

  </Target>

 

 

  • If you’re targeting .NET 6, then the packing list will be generated automatically from the .deps.json file.
Reply all
Reply to author
Forward
0 new messages