Set ie = New InternetExplorer
ie.Visible = True
If ComboBox1.Value = "TEST" Then
ie.navigate ("http://fr.test.com/app/search/")
Do Until ie.readyState = 4
DoEvents
Loop
Set IEDoc = ie.document
Set DOCelement = IEDoc.getElementById("keywords")
DOCelement.Value = TextBox6.Value
Set DOCelement = IEDoc.getElementById("Batch")
DOCelement.Value = TextBox7.Value
Set DOCelement = IEdoc.all("Search") DOCelement.Click
If WaitIE(ie, 6) Then 'c'est à ce moment que le message d'avertissement apparaît
SendKeys ("{TAB}") 'tab
SendKeys ("{ENTER}") 'enter
Else
... suite du code
end if
Public Function WaitIE(oIE As InternetExplorer, Optional pTimeOut As Long = 0) As Boolean
Dim lTimer As Double
lTimer = Timer
Do
DoEvents
If oIE.readyState = READYSTATE_COMPLETE And Not oIE.Busy Then Exit Do
If pTimeOut > 0 And Timer - lTimer > pTimeOut Then
WaitIE = True
Exit Do
End If
Loop
End Function