Option Compare Database Option Explicit Private Declare Function URLDownloadToFile Lib "urlmon" Alias _ "URLDownloadToFileA" ( _ ByVal pCaller As Long, ByVal szURL As String, _ ByVal szFileName As String, _ ByVal dwReserved As Long, _ ByVal lpfnCB As Long) As Long Sub DownloadFileFromWeb() Dim i As Integer Const strUrl As String = "http://backweb.bas-rhin.fr/perstein/parc-erstein/export/201407FISCHERAlain.xml" Dim strSavePath As String Dim returnValue As Long strSavePath = "C:\temp_\xml_2708.xml" returnValue = URLDownloadToFile(0, strUrl, strSavePath, 0, 0) End Sub Public Function testConnexionLecteur(ByVal lecteurVirtuel As String, ByVal repHttp As String) As Boolean On Error GoTo fin Dim essai As Integer Dim objFSO, objReseau As Object testConnexionLecteur = False Set objReseau = CreateObject("WScript.Network") If dir(lecteurVirtuel & "\", vbDirectory) <> "" Then 'déjà mappé Else objReseau.MapNetworkdrive lecteurVirtuel, repHttp End If testConnexionLecteur = True objReseau.RemoveNetworkDrive lecteurVirtuel, True fin: Set objReseau = Nothing End Function