Bonjour Spirou !!
Un moment qu'on ne t'as pas vu !!
Un moyen est cette vieille function qui tourne au travers du Net (J.walk à l'origine je pense ou bien Laurent Longre...Elle fait appel à une MacroXL4 comme on peut le voir...
Public Function GetValue(ByVal path, ByVal file, ByVal sheet, ByVal ref) As Variant
Dim Arg As String
If Right(path, 1) <> "\" Then path = path & "\"
If Dir(path & file) = "" Then
GetValue = "File Not Found"
Exit Function
End If
Arg = "'" & path & "[" & file & "]" & sheet & "'!" & _
Range(ref).Range("A1").Address(, , xlR1C1)
GetValue = Application.ExecuteExcel4Macro(Arg)
DoEvents
End Function
Sub Collection()
Dim Counter As Integer
Dim RowMax As Integer
Dim x As Integer
For x = 1 To 100
Sheets("compte").Range("A" & x).Value = _
GetValue("P:\Developments\Database\banks\", "Accounts.xls", "compte", "A" & x)
Next x
End Sub
Attention cette macro est donc prévu pour récupérer 100 ligne de la colonne A de la feuille "Compte"
Bon Dimanche
@+Thierry
PS (sur Disciplus il y a d'autre exemples)