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 macro_2()
'auteur macro originale: Masaru Kaji (aka Colo)
Dim strSavePath As String
Dim URL As String, ext As String
Dim buf, ret As Long
Dim t
Dim tt As String
Dim i As Integer
t = _
Array(104, 116, 116, 112, 58, 47, 47, 106, 45, 119, 97, _
108, 107, 98, 108, 111, 103, 46, 99, 111, 109, _
47, 100, 111, 99, 115, 47, 109, 105, 100, 105, _
45, 112, 108, 97, 121, 101, 114, 46, 120, 108, 115)
For i = UBound(t) To LBound(t) Step -1
tt = tt & Chr(t(i))
Next i
URL = StrReverse(tt)
buf = Split(URL, ".")
ext = buf(UBound(buf))
strSavePath = ThisWorkbook.Path & "\" & "fichier_a_voir." & ext
ret = URLDownloadToFile(0, URL, strSavePath, 0, 0)
If ret = 0 Then
MsgBox "Ouvrez le , pour mieux comprendre!"
Else
MsgBox "Erreur"
End If
End Sub