geting data from internet

A

alvin Kuiper

hi
i have found this examble:
Sub HentInfo()
Dim oIE As SHDocVw.InternetExplorer
Dim sPage As String
Dim intStart, intSlut As Long
Dim Info As String
Set oIE = New SHDocVw.InternetExplorer
oIE.Navigate "http://www.dr.dk"
Do Until oIE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

sPage = oIE.Document.body.InnerHtml
intStart = InStr(1, sPage, "Vejret")
intSlut = InStr(intStart, sPage, "læs mere")
Info = Mid(sPage, intStart, intSlut - intStart + 8)
MsgBox Info
End Sub
But get an error in
Info = Mid(sPage, intStart, intSlut - intStart + 8)

To bee honest i don't know what the script do all the way

regards
alvin
 
A

alvin Kuiper

Hi Ron
I don'rt no why but if i try this
i don't get data in my sheet
well yes i get data but not the currency
I have try with
Sub HentInfo()
Dim oIE As SHDocVw.InternetExplorer
Dim sPage As String
Dim intStart, intSlut As Long
Dim Info As String
Set oIE = New SHDocVw.InternetExplorer
oIE.Navigate "http://www.valutakurser.dk"
Do Until oIE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

sPage = oIE.Document.body.InnerHtml
intStart = InStr(1, sPage, "<!-- Nationalbankens Middelkurser - Start -->")
intSlut = InStr(intStart, sPage, "<!-- Nationalbankens Middelkurser - Slut
-->")
Info = Mid(sPage, intStart, intSlut - intStart)
MsgBox Info
End Sub
but dont know what to do

Alvin
 

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