Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Download files using MSXML2.XMLHTTP
i am having a little trouble downloading a file using MSXML2.XMLHTTP
the code below works great *if* you can get a link that leads directly to the file, as in the example below Quote: Private Sub test() Dim objHTTP As Object Set objHTTP = CreateObject("MSXML2.XMLHTTP") Dim stl As String Dim rt stl = "http://slmap.hostingweb.us/test/1.zip" objHTTP.Open "GET", stl, False, "test", "test" 'unme/pwd objHTTP.send rt = objHTTP.responseBody Dim oADOStream Set oADOStream = CreateObject("ADODB.Stream") oADOStream.Type = 1 oADOStream.Mode = 3 oADOStream.Open oADOStream.Write rt oADOStream.SaveToFile "c:\anyfilename.zip" oADOStream.Close Set oADOStream = Nothing Set objHTTP = Nothing End Sub unfortunately it 'freezes' when trying to pull a file from a different sort of link, something like: http://anysite.com/231/en-us/abc/gog...3&saveas=1.zip i think it freezes because the link wants to open a dialogue box or something. i have tried to retool the link, or find another one that is directly connected to the file, but on some of these monster servers with the way they deal with uploads and downloads the best i can do is the link i just showed. it is one of those email attachement links. has anybody had any experience with this? using a webbrowser you can navigate to the link, but the webbrowser is generlaly much slower so i want to go the MSXML2.XMLHTTP route if possible. it has been working great for just about everything, but i ran into this snag and need some help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Slow download of .xls files | Excel Discussion (Misc queries) | |||
MSXML2.XMLHTTP clear excel cache/memory (?) | Excel Programming | |||
download to be able to save files as CSV in Excel? | Excel Discussion (Misc queries) | |||
Can Excel download files? | Excel Programming | |||
Download files with excel | Excel Programming |