This procedure used to work before IE8

A

Albert

Hello!

I have a procedure which did very nicely by going into a webpage, doing
stuff and bringing me data. However, it stopped working after I updated to
IE8. I get an "Automatization Error" at the ".Navigate sURL" of the procedure
(see below).

Could someone help me fix it?
Do I have to change the reference? I currently have a reference to:
Microsoft Internet Controls
Microsoft HTML Object Library
OLE Automation
and the other stuff that's usually there for everyone....

I thank you in advance for any help.

Here's the relevant part of the procedure.

Dim appIE As InternetExplorer
Dim sURL As String
Dim UserN As Variant, PW As Variant
Dim Element As HTMLButtonElement
Dim btnInput As MSHTML.HTMLInputElement
Dim ElementCol As MSHTML.IHTMLElementCollection
Dim Link As MSHTML.HTMLAnchorElement
Dim strCountBody As String
Dim lStartPos As Long
Dim lEndPos As Long
Dim TextIWant As String

Application.ScreenUpdating = False

Set appIE = New InternetExplorer

sURL =
"http://www.infoval.com.co/spivi2/JInterna.jsp?nomPagina=JNSBetas.jsp"

With appIE
.Navigate sURL
' uncomment the line below if you want to watch the code execute, or
for debugging
'.Visible = True
End With

Do Until appIE.readyState = READYSTATE_COMPLETE
Loop

'Do lots of stuff in there......
 
R

r

try this ...

Sub testIE()
' late binding
Dim myIE As Object
Set myIE = CreateObject("InternetExplorer.Application")
Const READYSTATE_COMPLETE As Long = 4
Const myURL As String = "http://www.infoval.com.co/" & _
"spivi2/JInterna.jsp?nomPagina=JNSBetas.jsp"

myIE.navigate myURL
myIE.Visible = True

Do While myIE.Busy Or myIE.readyState <> READYSTATE_COMPLETE
DoEvents
Loop

End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/index.php/Excel-VBA/UsedRange-eccezioni-e-alternative.html
 
A

Albert C

Yep.
Now it works.
Thank you sir!

r said:
try this ...

Sub testIE()
' late binding
Dim myIE As Object
Set myIE = CreateObject("InternetExplorer.Application")
Const READYSTATE_COMPLETE As Long = 4
Const myURL As String = "http://www.infoval.com.co/" & _
"spivi2/JInterna.jsp?nomPagina=JNSBetas.jsp"

myIE.navigate myURL
myIE.Visible = True

Do While myIE.Busy Or myIE.readyState <> READYSTATE_COMPLETE
DoEvents
Loop

End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/index.php/Excel-VBA/UsedRange-eccezioni-e-alternative.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top