PerformDefaultRegistration() and Excel

47 views
Skip to first unread message

Paul Margus

unread,
Sep 20, 2022, 8:18:31 PM9/20/22
to exce...@googlegroups.com, govert.va...@gmail.com

Hi Govert –

 

I’m working on a project involving spreadsheet function registration.

 

Initially, my project was using the following ExcelDna packages.

  • ExcelDna.AddIn, version 1.5.1
  • ExcelDna.Integration, version 1.5.1
  • ExcelDna.Interop, version 15.0.0
  • ExcelDna.Registration, version 1.5.1
  • ExcelDna.Registration.VisualBasic, version 1.5.1

 

I experienced the now-familiar anti-virus bug in Windows Defender.   As of 2022-09-20, Microsoft hasn’t fixed it.

 

I’m registering my spreadsheet functions following standard procedures:

 

  • In the dna file:

<ExternalLibrary

Path="Kalends.dll"

ExplicitRegistration="true"

LoadFromBytes="true"

Pack="true" />

  • In Public Sub AutoOpen() Implements IExcelAddIn.AutoOpen:

 

PerformDefaultRegistration()

 

But execution stops at PerformDefaultRegistration(), with the following message:

System.NullReferenceException

HResult=0x80004003

Message=Object reference not set to an instance of an object.

Source=ExcelDna.Loader

 

I have an earlier version of this project, which has always worked fine.  After searching high and low, I found only one significant difference: The older version uses an older version of ExcelDna.

 

So, I downgraded to version 1.1.0 or 14.0.1 as appropriate.  Then PerformDefaultRegistration() worked perfectly.  And, as you have indicated elsewhere, Windows Defender stopped complaining.

 

Now I’m suspicious:  Do you think that Windows Defender was somehow erasing the “instance of an object”?

 

Everything now seems fine, except that when a signature includes an Enumeration, a DnaMarshalException results.  If that’s merely a limitation of the earlier ExcelDna version, I can deal with it.

 

Any comments would be appreciated.

 

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.

 

image001.jpg

Govert van Drimmelen

unread,
Sep 21, 2022, 8:53:43 AM9/21/22
to Excel-DNA
Hi Paul,

Can you try to update your project to the current pre-release version 1.6.0-rc1?
I think that should not give you the Defender problems, and might fix the registration error too.

-Govert

Pa...@MargusConsulting.com

unread,
Sep 23, 2022, 5:00:26 PM9/23/22
to Excel-DNA
Hi Govert --

Just finished upgrading to pre-release version 1.6.0-rc.  Everything seems great:
  • Windows Defender is totally quiet, and
  • Sub PerformDefaultRegistration() is now functioning perfectly.
I'll continue using 1.6.0-rc until you replace it with the next stable version.

Thanks for your help. ExcelDna is an excellent package!

-- Paul
Reply all
Reply to author
Forward
0 new messages