Hi Alberto,
Your VBA code that uses the ExcelDna.Registration.VisualBasic extension would typically look like the sample add-in here:
where you would call
PerformDefaultRegistration()
to deal with the typical registration changes.
This should deal with your ParamArray functions.
However, to support enums you need to make your own registration conversions, so the code will look more like the C# sample here:
which has extra conversion functions for the enum <-> string conversions – see line 96:
// This is a pair of very generic conversions for Enum types
.AddReturnConversion((Enum value) => value.ToString(), handleSubTypes: true)
.AddParameterConversion(ParameterConversions.GetEnumStringConversion())
and then your registration function gets a lot more complicated.
So I don’t have a nice example there which shows how to do custom conversions or enums in VisualBasic.
It’s probably easier to do the enum <-> string conversions inside your functions (so you declare the function with a string parameter and call Enum.Parse inside your own function)
-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.
The VB sample project has a function that has a Range argument in https://github.com/Excel-DNA/Registration/blob/master/Source/Samples/Registration.Sample.VisualBasic/RangeParameterExamples.vb
<ExcelFunction>
Function dnaVbRangeTest(input As Range) As String
Return input.Address
End Function
Maybe you can try to get the sample to work, then see how it differs from your code.
-Govert
From: exce...@googlegroups.com [mailto:exce...@googlegroups.com]
On Behalf Of Alberto Ghiglia
Sent: 27 September 2017 17:53
To: Excel-DNA <exce...@googlegroups.com>
Subject: [ExcelDna] Re: Param Array support and Excel-DNA.Registration
Hi Govert
--