Variants Can't hold MulitiDimentional Arrays?

I just got this Error:

This type conversion is only implemented for one-dimensional arrays
GroupDic.Value(GroupTitle.Text.Trim) = GroupData

Group Data isa 2D array… I can use am array of pairs instead, but I wanted to avoid then as they are variants too and I ty to minimize the use of variants… and did not want to create another class

But should not variants be able to hold anything?

  • Karen

This works in older versions.

A variant can hold an array.
Just when you get it out, you have to assign it back to the right variable of same type.

Are you sure this also works and always worked with multi-dimensional arrays, though?

Klar, geht schon immer so:

Dim n(2,3,4) As Integer
n(2,2,2) = 123

Dim v As Variant = n

Dim x(0,0,0) As Integer = v

Dim t As Integer = x(2,2,2)
Break
1 Like