PM>Install-Package ExcelDNA.Addin
PM>Install-Package ExcelDNA.Registration.VisualBasicImports ExcelDna.IntegrationImports ExcelDna.Registration.VisualBasic
Public Module Module1 <ExcelFunction> Public Function SayHello(Optional aName As String = "Bill") Return "Hello" & aName End FunctionEnd Module
Public Class MyAddin Implements IExcelAddIn
Public Sub AutoOpen() Implements IExcelAddIn.AutoOpen PerformDefaultRegistration() End Sub
Public Sub AutoClose() Implements IExcelAddIn.AutoClose End Sub
End ClassRegistration [Error] Repeated function name: 'SayHello' - previous registration will be overwritten.
ExplicitRegistration:=True,
SuppressOverwriteError:=True
<ExternalLibrary Path='MyAddin.dll' LoadFromBytes='true' Pack='true' ExplicitExports='true' ExplicitRegistration='true' />
Hi Daniel,
Everything you’ve said is correct. It’s a bit clumsy due to the historical evolution of the library, and me wanting to maintain backward compatible behaviour.
The intention, for normal use, is option (3), where you set ExplicitRegistration=true in the .dna file when using the Registration extension, if you will be doing the default processing – this is reflected in the Registration sample projects.
It would indeed be nice to have that applied by the NuGet package, or at least have some usage guidelines…
By default, a function marked with an [ExcelFunction] will be registered (i.e. it will have ExplicitRegistration=false for that function. However, the [ExcelAsyncFunction] attribute in the Registration extension overrides this default property value, and sets ExplicitRegistration=true. I think I did this because we expect such functions to have a compatible signature with Excel (e.g. return “double”), but to be registered explicitly with the generated async wrapper. So the apparent discrepancy is intended, but nothing too strange is going on.
-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.
Hi Daniel,
Thank you – updating the Readme would already help the next person in your position.
Regards,
Hi Daniel,
Thank you – updating the Readme would already help the next person in your position.
Regards,
Govert
Thanks Daniel – I’ve added the comment.
-Govert
From: exce...@googlegroups.com [mailto:exce...@googlegroups.com]
On Behalf Of Daniel T
Sent: 28 November 2016 15:52
To: Excel-DNA <exce...@googlegroups.com>
Subject: Re: [ExcelDna] Re: "Repeated Function Name" warning with ExcelDna.Registration.VisualBasic PerformDefaultRegistration()
Feel free to pull from https://github.com/SeeSpotRun/Registration/commit/d149df83b73bc8a05f9dbc831f200947c86ff052
--
To post to this group, send email to exc...@googlegroups.com.