Function WebHTML(ByVal sURL As String) As String
Dim objLink As HTMLLinkElement
Dim objMSHTML As New MSHTML.HTMLDocument
Dim objDocument As MSHTML.HTMLDocument
Set objDocument = objMSHTML.createDocumentFromUrl(sURL, vbNullString)
Do While objDocument.readyState <> "complete"
DoEvents
'Wscript.sleep 50
Loop
WebHTML = objDocument.documentElement.innerHTML
Set objLink = Nothing
Set objMSHTML = Nothing
Set objDocument = Nothing
End Function
Tool->add reference-> Microsoft HTML object library
This works now but ask security prompt x2 when run.
can I skip the prompt?
Another way is to CreateObject InternetExplorer.Application but IE crash easily after run few times.
Bookmarks