ExcelDna icon indicating copy to clipboard operation
ExcelDna copied to clipboard

UDF is not able to get more than 4 parameters on ARM64 / Apple M1 machines

Open eyalmolad opened this issue 2 years ago • 2 comments

.NET 4.7.2 Excel DNA 1.1.1 ExcelDNA Integration 1.1.0

I have a following UDF in my Excel addin:

[ExcelFunction(Name = "MyFn1", Description = "Get data", IsMacroType = true, IsThreadSafe = false)]
       public static object MyFn1(string queryId, string p1Name, object p1Value, string p2Name, object p2Value,
                                  string p3Name, object p3Value,
                                  string p4Name, object p4Value, 
                                  string p5Name, object p5Value,
                                  string p6Name, object p6Value)
{
    // all parameters from p2Value to p6Values, gets ExcelDna.Integration.ExcelMissing 
}

On some of the machines that run Excel 365 on Paralels MAC, we are not able to get more then 4 parameters in the UDF. Lets say that I have the following formula in the Excel: = MyFn1("1", "param1","val1","param2","val2","param3","val3") I will receive the values until the param2.

Have anyone experienced such behavior?

Thanks

eyalmolad avatar Jun 14 '22 13:06 eyalmolad

This is a known bug in Excel on the ARM64 architecture. See this discussion: https://groups.google.com/g/exceldna/c/jCee3l0lzjM/m/iZA9FnQXDQAJ

We have reproduced the bug with the native code sample add-in from the Excel SDK and reported to Microsoft in November. We don't have any indication of when this will be fixed - you might try to press the 'Frown' feedback button, or report in some other way to Microsoft.

A (rather inconvenient) workaround is to remove Office completely and then install the 32-bit version.

govert avatar Jun 14 '22 13:06 govert

@govert i clicked the 'Frown' button 2 weeks ago and wrote feedback... I can also confirm that with the most current Excel build this is still happening.

gmichaud avatar Aug 24 '22 20:08 gmichaud

The Excel team have fixed this - it should work right in Excel build 2211 and later, currently available in the Beta channel.

govert avatar Nov 14 '22 14:11 govert