Problem with VBA and Internet Explorer integration

Asked

Viewed 989 times

1

I am trying to use VBA to collect data directly from the internet. I saw several examples of the use of the Internetexplorer Object, as below:

Dim IE as Object
Set IE  = New InternetExplorer

IE.navigate "http://www.minhapagina.com.br"

html = IE.Document

So you could manipulate the html object and get the data I need, however the document object is always empty. How to proceed?

  • Related: http://answall.com/questions/45142/macro-para-acessar-site-com-login

1 answer

2


Checks whether it helps:

Dim IE As InternetExplorer
Dim ieDoc As Object
Set IE  = New InternetExplorer
IE.Visible = True 'para verificar se abre o browser
IE.navigate "http://www.minhapagina.com.br"

'possivelmente esta é a parte que te falta
Do While IE.Busy: DoEvents: Loop
Do Until IE.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop

Set ieDoc = ieApp.Document

A good example: Get Data from Website that Requires a Login

Browser other questions tagged

You are not signed in. Login or sign up in order to post.