Private Function AssainirURL(MonURL As String) As String
On Error GoTo FonctionErreur
Dim URLtemporaire As String
URLtemporaire = MonURL
URLtemporaire = Replace(URLtemporaire, "%", "%25", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, Chr(10), "%0A", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, Chr(13), "%0D", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, ":", "%3A", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, " ", "%20", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, """", "%22", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "#", "%23", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "$", "%24", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "&", "%26", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "'", "%27", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "(", "%28", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "°", "%C2%B0", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, ")", "%29", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "*", "%2A", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "+", "%2B", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, ",", "%2C", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, ";", "%3B", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "<", "%3C", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "=", "%3D", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, ">", "%3E", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "?", "%3F", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "@", "%40", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "[", "%5B", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "]", "%5D", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "^", "%5E", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "`", "%60", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "{", "%7B", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "|", "%7C", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "}", "%7D", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "~", "%7E", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "¢", "%C2%A2", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "£", "%C2%A3", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "¥", "%C2%A5", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "|", "%A6", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "§", "%C2%A7", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "«", "%C2%AB", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "¬", "%C2%AC", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "¯", "%C2%AF", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "º", "%C2%BA", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "±", "%C2%B1", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ª", "%C2%AA", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, ",", "%B4", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "µ", "%C2%B5", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "»", "%C2%BB", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "¼", "%C2%BC", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "½", "%C2%BD", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "¿", "%C2%BF", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "À", "%C3%80", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Á", "%C3%81", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Â", "%C3%82", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ã", "%C3%83", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ä", "%C3%84", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Å", "%C3%85", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Æ", "%C3%86", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ç", "%C3%87", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "È", "%C3%88", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "É", "%C3%89", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ê", "%C3%8A", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ë", "%C3%8B", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ì", "%C3%8C", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Í", "%C3%8D", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Î", "%C3%8E", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ï", "%C3%8F", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ð", "%C3%90", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ñ", "%C3%91", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ò", "%C3%92", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ó", "%C3%93", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ô", "%C3%94", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Õ", "%C3%95", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ö", "%C3%96", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ø", "%C3%98", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ù", "%C3%99", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ú", "%C3%9A", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Û", "%C3%9B", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ü", "%C3%9C", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Ý", "%C3%9D", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "Þ", "%C3%9E", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ß", "%C3%9F", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "à", "%C3%A0", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "á", "%C3%A1", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "â", "%C3%A2", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ã", "%C3%A3", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ä", "%C3%A4", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "å", "%C3%A5", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "æ", "%C3%A6", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ç", "%C3%A7", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "è", "%C3%A8", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "é", "%C3%A9", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ê", "%C3%AA", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ë", "%C3%AB", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ì", "%C3%AC", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "í", "%C3%AD", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "î", "%C3%AE", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ï", "%C3%AF", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ð", "%C3%B0", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ñ", "%C3%B1", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ò", "%C3%B2", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ó", "%C3%B3", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ô", "%C3%B4", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "õ", "%C3%B5", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ö", "%C3%B6", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "÷", "%C3%B7", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ø", "%C3%B8", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ù", "%C3%B9", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ú", "%C3%BA", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "û", "%C3%BB", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ü", "%C3%BC", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ý", "%C3%BD", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "þ", "%C3%BE", compare:=vbBinaryCompare)
URLtemporaire = Replace(URLtemporaire, "ÿ", "%C3%BF", compare:=vbBinaryCompare)
AssainirURL = URLtemporaire
Exit Function
FonctionErreur:
AssainirURL = CVErr(xlValue)
End Function