I have a usercontrol into which I want to copy data.

The data is in the form of an array of singles.
The data is loaded using a property. (get/let)
The data is stored by the usercontrol in an array of singles.

This goes for two sets of data, each has it's own source array, property and destination array.

When I copy the first array it works fine.
When I copy the second array it gives an error:
Runtime 13: type mismatch.

I tested this with a second sub that only copies teh data and only a little bit. (second commandbutton)
This gives the same error.

What is weird is that the error always comes when I copy the second array, even if I swap the lines.

I checked that everything involed uses an array of singles.

What could be the issue?

The form:
vb Code:
  1. Private Sub c_Click()
  2. Dim f As Long
  3. Dim ds() As String
  4. Dim i As Long
  5.  
  6. Dim t As Single
  7. Dim dt() As Single
  8. Dim dx() As Single
  9.    
  10.     cd.FileName = vbNullString
  11.     cd.ShowOpen
  12.     If Dir(cd.FileName) <> vbNullString And cd.FileName <> vbNullString Then
  13.         ReDim ds(0)
  14.         f = FreeFile
  15.         Open cd.FileName For Binary As #f
  16.         ds(0) = String(LOF(f), " ")
  17.         Get #f, , ds(0)
  18.         Close #f
  19.         ds = Split(ds(0), vbCrLf)
  20.        
  21.         ReDim d(UBound(ds))
  22.         For i = 0 To UBound(ds)
  23.             d(i) = ProcessData(ds(i), Len(ds(i)), False)
  24.         Next i
  25.         Erase ds
  26.        
  27.         ReDim dt(UBound(d))
  28.         ReDim dx(UBound(d))
  29.         For i = 0 To UBound(d)
  30.             If i > 0 Then
  31.                 If d(i).Lap_Current > d(i - 1).Lap_Current Then t = t + d(i).LapTime_Last
  32.             End If
  33.             dt(i) = t + d(i).LapTime_Current
  34.             dx(i) = d(i).BrakeTemp_LF
  35.         Next i
  36.        
  37.         Erase d
  38.        
  39.         'hgLF is an instance of the usercontrol
  40.         hgLF.DataX = dx
  41.         hgLF.DataY = dt '<-- runtime 13, type mismatch
  42.        
  43.         hgLF.Draw        
  44.     End If
  45.    
  46. End Sub
vb Code:
  1. Private Sub Command1_Click()
  2. Dim a() As Single
  3. Dim b() As Single
  4.  
  5.     ReDim a(1000)
  6.     ReDim b(1000)
  7.    
  8.     hgLF.DataY = b
  9.     hgLF.DataX = a '<-- runtime 13, type mismatch
  10. End Sub

The usercontrol:
vb Code:
  1. Private varDataX() As Single
  2. Private varDataY() As Single
  3.  
  4. Public Property Get DataX() As Single()
  5.     DataX = varDataX
  6. End Property
  7. Public Property Let DataX(nDataX() As Single)
  8.     varDataX = nDataX
  9. End Property
  10.  
  11. Public Property Get DataY() As Single()
  12.     DataY = varDataY
  13. End Property
  14. Public Property Let DataY(nDataY() As Single)
  15.     varDataY = nDataY
  16. End Property