Une adresse de cellule pour un tel lien ? De toute manière, les liens, c'est lent …
Sinon voici une autre approche (sans référence à activer), voir la procédure Demo :
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 36 37 38 39
| 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(9, URL, "/"): If P Then URL = Left$(URL, P)
WebOK = InternetCheckConnectionA(URL, 1, 0)
End Function
Sub Demo()
Dim Hlk As Hyperlink
With Feuil1
If WebOK(.Hyperlinks(1).Address) = False Then Beep: Exit Sub
ReDim DT(1 To .UsedRange.Rows.Count, 1 To 1)
For Each Hlk In .Hyperlinks
With CreateObject("MSXML2.XMLHTTP")
.Open "POST", Hlk.Address, False
.Send
If .Status = 200 Then
T$ = .responseText
P& = InStr(T, "End of placement</td><td>")
If P Then
T = Mid$(T, P + 25, 10)
If IsDate(T) Then DT(Hlk.Parent.Row, 1) = T
End If
End If
End With
DoEvents
Next
.[E1].Resize(UBound(DT)) = DT
Beep
End With
End Sub |
J'ai allégé au maximum mes procédures habituelles pour
grapiller du temps …
Les dates stockées dans une variable tableau sont inscrites en colonne en une fois à la fin de la procédure (ligne n°36);
mais en insistant sur la touche
Echap, grâce à la ligne n°33, l'exécution peut être interrompue puis,
via le bouton
Débogage, le processus peut être redirigé vers la ligne n°36 …
__________________________________________________________________________________________
Merci de cliquer sur
pour chaque message ayant aidé puis sur
pour clore cette discussion …
__________________________________________________________________________________________
Pour s'endormir, un mouton ne peut compter que sur lui-même …
Partager