Dim IE As InternetExplorer
Dim IEDoc As HTMLDocument
Dim InputZoneTexte As HTMLInputElement
Dim winShell As New ShellWindows
Dim DIS As String
DIS = "AAAA900BUNEP"
GoTo finerreur
erreur:
MsgBox " ATTENTION : Veillez à avoir une fenêtre ouverte"
Exit Sub
finerreur:
'Set IE = ("internetExplorer.Application")
'IE.Visible = True
For Each IE In winShell '
If Left(Trim(IE.LocationURL), 10) = "https://mapage.html" Then GoTo suite1
Next IE
GoTo erreur
suite1:
'IE.navigate ("https://mapage.html") 'page de recherche
'While IE.ReadyState <> READYSTATE_COMPLETE Or IE.Busy = True '
' DoEvents
'Wend
IE.navigate ("https://https://mapage.html") 'page de 'garde
While IE.ReadyState <> READYSTATE_COMPLETE Or IE.Busy = True
DoEvents
Wend
Set IEDoc = IE.document
Set InputZoneTexte = IEDoc.all("idBarcodeSearchInput")
InputZoneTexte.Value = ""
InputZoneTexte.Value = DIS & vbLfCr
SendKeys "{ENTER}", True
Set IEDoc = Nothing
Set InputZoneTexte = Nothing
End Sub