I have an application in VBA that gives to my VB.Net dll one bi-dimensional variant. It is a an array, in which every component is a another array containing two positions.
I want to get this two-position array. When I am using VBA I can access directly the data from each position by doing:
dataArray(index, 0) or dataArray(index, 1)
And when I want to get the two-position array I can use:
Dim posArray as variant
posArray = dataArray(index)
posArray(0) contains dataArray(index, 0) and posArray(1) contains dataArray(index, 1).
But when I am using VB.Net, I can access directly the data, just like the first example. However, when I try to get one dimension from the two-dimension array, like I did in the second example, it is not possible.
Dim posArray as Object
posArray = dataArray(index)
It says "Attempted to operate on an array with the incorrect number of dimensions."
I have tried everything to make it work, and I don't want to make the attribution one by one, like:
posArray(0) = dataArray(index, 0)
posArray(1) = dataArray(index, 1)
Thank you for the help.