Oui, un peu dans les nuages ! …
Voici une approche avec la librairie
Microsoft XML :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| ' Menu Outils, Références : cocher Microsoft XML, v3.0
Private Declare Function InternetCheckConnectionA Lib "Wininet" (ByVal Site$, ByVal one&, _
ByVal zero&) As Boolean
Function WebOK(Optional ByVal URL$ = "http://www.msn.com") As Boolean
P& = InStr(8, URL, "/"): If P Then URL = Left$(URL, P)
WebOK = InternetCheckConnectionA(URL, 1, 0)
End Function
Function WebText$(SOURCE$, Optional START$)
Dim oXhttp As New MSXML2.XMLHTTP
If WebOK(SOURCE) = False Then Exit Function
oXhttp.Open "POST", SOURCE, False
oXhttp.send
If oXhttp.Status = 200 Then
T$ = oXhttp.responseText
If START > "" Then
S& = InStr(T, START)
If S Then T = Mid$(T, S) Else T = ""
End If
WebText = T
End If
Set oXhttp = Nothing
End Function
Sub Demo()
Debug.Print WebText("http://static.meteo-paris.com/station/NOAAMO.TXT")
End Sub |

__________________________________________________________________________________________
Merci de cliquer sur

pour chaque message ayant aidé puis sur

pour clore cette discussion …
__________________________________________________________________________________________
Des chercheurs qui cherchent, on en trouve. Des chercheurs qui trouvent, on en cherche ! (Charles De Gaulle)
Partager