My previous version of exceldna was relatively old (not "SDK-style project"), and I want to upgrade to the latest version.
So, I created a new "Class Library" template and used "ExcelDna.Addin 1.8.0"
Then I tried to port my original code to this new project.
During the transplantation process, I encountered some problems and would like to ask for confirmation. (The "
vb.net" version I use)
1. Has the new version canceled support for range type parameters? If you want to pass in a range object in udf, you need to process it according to ExcelReference and then convert it?
Because in the old version, UDF supports directly defining the parameter type into the range format (it seems that it was not possible at the beginning, and then it was supported after installing the ExcelDna.Registration.VisualBasic library. I remember it very clearly)
But in the new version, I found that it is no longer possible to explicitly define the parameter type of udf into range format. What I'm referring to is this:
[Accepting Range Parameters in UDFs | Excel-DNA](
https://excel-dna.net/docs/guides-basic/accepting-range-parameters-in-udfs)
2. Changes in citation methods
Assume that the anchor variable is of range type (converted by the ReferenceToRange function)
dim a= anchor.Offset(1, 0).Columns(1)).value
This code originally (in the old version) was valid (regardless of whether the number of cells in the range was one or more)
But in the new version, this operation will report an error:
System.MissingMemberException
Must be changed to:
Dim anchor_offset As Range = anchor.Offset(1, 0).Columns(1)
dim a= anchor_offset.Value
will be normal
Don't quite understand why this is happening?