Results 1 to 1 of 1
2013-09-19, 19:40 #1
- Join Date
- Feb 2011
- Thanked 0 Times in 0 Posts
Excel macro to get HTTP source via MSXML2.XMLHTTP
I submitted a question yesterday w/title Excel vba to get IE source. I had a working
solution using MSXLM2.XMLHTTP to read the source without opening IE (or FireFox).
The site did an upgrade so now the source received indicates the requested page
requires an up-to-date viewer. So, as an alternate to yesterday's question, can this
be changed so as to fake the source to appear as submitted by Firefox?
Public Sub ShowHTML(ByVal strURL) 'Copied from http://stackoverflow.com/questions/2520949/getting-html-source-with-excel-vba On Error GoTo ErrorHandler Dim strError As String strError = "" Dim oXMLHTTP As MSXML2.XMLHTTP Set oXMLHTTP = New MSXML2.XMLHTTP strResponse = "" With oXMLHTTP .Open "GET", strURL, False .sEnd "" ... strResponse = .responseText ...
Sub open(bstrMethod As String, bstrUrl As String, [varAsync], [bstrUser], [bstrPassword])
There is also
Sub setRequestHeader(bstrHeader As String, bstrValue As String)
that might be helpful.
Last edited by Buford Carter; 2013-09-19 at 19:47.