When I try to call the next Excel-DNA method in VBA, I get only an array of size 1 (after 65536 lines, the array seems to change to the size of the real array - 65537). When a method is called in a sheet as an array function, everything works.
[ExcelFunction(Description = "Example", Name = "Example", HelpTopic = "")] public static object[] example() { object[] ret = new object[65537]; return ret; }
I work with Excel 2007, the sheet is xlsm-Worksheet, when using two-dimensional arrays like this, everything works fine.
[ExcelFunction(Description = "Example", Name = "Example", HelpTopic = "")] public static object[,] example() { object[,] ret = new object[65537,1]; return ret; }
But using two-dimensional arrays, on the contrary, is the same as if one happens
[ExcelFunction(Description = "Example", Name = "Example", HelpTopic = "")] public static object[,] example() { object[,] ret = new object[1,65537]; return ret; }
Does anyone have any ideas how to get around this?
Doing the same thing in VBA works fine
Function test() Dim ret As Variant ReDim ret(65536) test = ret End Function Sub testSub() Dim output output = Application.Run("test") End Sub
the output has a size of 65537 (indexing starts at 0), as well as numbers greater than 65537.