IE 9 no acepta SendKeys
He publicado enIE 9 no acepta SendKeys para descargar un archivo, pero este problema es lo suficientemente separado de la respuesta que recibí para justificar otra pregunta. Mi problema es que no puedo hacer que IE 9 acepte ninguno de losSendKeys
. He intentadoPágina abajo, Lengüeta, toda laF# Llaves, y ninguna de ellas funciona.
Aquí está el código que estoy usando:
Dim ie As Object
'This creates the IE object
Sub initializeIE()
'call this subprocedure to start internet explorer up
Set ie = CreateObject("internetexplorer.application")
pos = 1
End Sub
'Initialize the class object
Private Sub Class_Initialize()
initializeIE
End Sub
Function followLinkByText(thetext As String) As Boolean
'clicks the first link that has the specified text
Dim alink As Variant
'Loops through every anchor in html document until specified text is found
' then clicks the link
For Each alink In ie.document.Links
If alink.innerHTML = thetext Then
alink.Click
'waitForLoad
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{PGDN}", True
Application.SendKeys "{PGUP}", True
'I've also tried calling it without Application before it
SendKeys "{F1}", True
SendKeys "{F2}", True
'Etc... Each of these not being received by IE 9
followLinkByText = True
Exit Function
End If
Next
End Function
Estoy en una pérdida total porque parece que la mayoría de los foros o tutoriales no hacen nada diferente para IE 9. El objeto IE se crea en un módulo de clase y se inicializa en elClass_Initialize
sub. No estoy seguro de si eso ayuda, pero realmente no tengo idea de por qué esto no funciona y cualquier ayuda sobre cómo enviar claves a IE sería muy apreciada.