With CreateObject("WinHttp.WinHttpRequest.5.1") .Open "GET", "https://mfi-assets.ecb.int/dla/EA/ea_all_100125.txt", True .Send Do Until .WaitForResponse(10) DoEvents Loop Open "C:\a.txt" For Output As #1 Print #1, .ResponseText; Close #1 End With
Sub telechargerfichier(surl As String) ' destination (app.path + nom du fichier distant) Dim sDest As String sDest = App.Path If RightB$(sDest, 2) <> "" Then sDest = sDest & "" End If sDest = sDest & Mid$(surl, 1 + InStrRev(surl, "/")) ' download If URLDownloadToFile(0&, surl, sDest, 0&, 0&) = 0 Then MsgBox "Fichier téléchargé :" & vbNewLine & sDest, vbInformation, "Réussite" Else MsgBox "Erreur ....", vbExclamation, "Echec" End If End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question