0

I have been using the following function in Excel VBA with my 32 bit machine and recently upgraded to a 64bit machine and the 64 bit version of Excel 2013. It still works somewhat, but only downloads a part of the http code. I have looked all over the place and I cannot find anything to suggest how to fix this; would really appreciate some help in getting this to work again. Thanks Dave

Function SaveWebFile(ByVal vWebFile As String, ByVal vLocalFile As String) As Boolean
    Dim oXMLHTTP As Object, i As Long, vFF As Long, oResp() As Byte
    Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP")
    oXMLHTTP.Open "GET", vWebFile, False 'Open socket to get the website
    oXMLHTTP.Send 'send request
    Do While oXMLHTTP.readyState <> 4
        DoEvents
    Loop
    oResp = oXMLHTTP.responseBody 'Returns the results as a byte array
    vFF = FreeFile
    If Dir(vLocalFile) <> "" Then Kill vLocalFile
    Open vLocalFile For Binary As #vFF
    Put #vFF, , oResp
    Close #vFF
    Set oXMLHTTP = Nothing
End Function
5
  • I did not get your question!
    – Michael
    Jan 31, 2015 at 0:20
  • You mean you don't understand what I am asking for? Jan 31, 2015 at 0:29
  • The above code works perfectly when I run it with excel 2010 32 bit, but when I run it with excel 2013 64 bit, I get a truncated version of the html code... Jan 31, 2015 at 2:11
  • I believe this has something to do with ie11 vs ie8. Whereas the particular website allowed me to fetch web pages after I had logged in with my password while using ie8, it does not seem to do so when using ie11. Jan 31, 2015 at 15:50
  • Definitely an issue with ie11 not passing cookies to the website. Anyone know a workaround for this? Jan 31, 2015 at 18:43

1 Answer 1

-1

Have you tried oXMLHttp.responseText ?

1
  • this could be the comment not the answer Aug 2, 2017 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.