IE 9 não aceitando SendKeys
Eu postei emIE 9 não aceitar SendKeys para baixar um arquivo, mas este problema é bastante separado da resposta que recebi para justificar outra questão. Meu problema é que não consigo fazer com que o IE 9 aceite nenhuma dasSendKeys
. Eu tenteiPage Down, Aba, todos osF # chaves, e nenhum deles funciona.
Aqui está o código que estou 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
Eu estou em uma perda total, porque parece que a maioria dos fóruns ou tutoriais não fazem nada diferente para o IE 9. O objeto IE é criado em um módulo de classe e inicializado noClass_Initialize
sub. Eu não tenho certeza se isso ajuda qualquer um, mas eu realmente não tenho idéia porque isso não está funcionando e qualquer ajuda sobre como enviar as chaves para o IE seria muito apreciada.