Problem with function taking in integer arrays

Apr 29, 2014 at 7:32 AM
Hey guys,

I'm new to Excel-DNA and I've found (potentially) an issue with passing array of integer into VB.
I've wrote a simple addThis code (below) but I could not find the function in Excel's (ie using it will give a #name error).

Changing everything from integer to double fixes the problem.

Thoughts?
    Public Function addThis(ByVal arr(,) As Integer) As Integer
        Dim result As Integer
        For Each num In arr
            result = result + num
        Next

        addThis = result
    End Function
Coordinator
Apr 29, 2014 at 10:25 AM
Hi Chris,

Excel-DNA does not currently support integer arrays. You'd have to do the conversion from double(,) or object(,) yourself.

-Govert
Apr 29, 2014 at 11:52 PM
Ah alright. Thanks Govert.
Again thanks for the great program! It's pretty useful!