Bonjour,

J'ai petit soucis pour retourner un Array à ma procédure appelante :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Sub Button1_Click()
 
  Dim testarray As Variant
  testarray = test()
 
  Dim i As Integer
  For i = 0 To 1
   MsgBox "" & testarray(i) 'ici il me retourne un type mismatch
  Next i
 
End Sub
 
 
Function test() As Variant
 
    Dim MyArray(1) As String
    MyArray(0) = 10
    MyArray(1) = 30
 
End Function