To Tom Lavedas:
Thank you Tom for the help. I knew that it was possible....and yours is the
ideal solution that I am looking for.
The problem is that it is failing in the saveToFile method.
Obviously, the path does exist and don't expect permission/security is the
cause of the failure.
I did not try a binary file, but I am sure that it will fail the same way.
This is an ascii/htmls file.....so oXml.ResponseText property does have
the text of the page.
Also, I can see the responseBody stream in a char array.
I am sure it is the Flags problem. I can take it from here with more
research and exprerimentation...... but if you don't have anything else more
productive to do, can you figure it out by just looking at the flags. Err:
3004 Error: Write to file failed.
Thanks a Billion
Travis McGee
Boston
Sub bringFilesFromWebSite()
sFilePath = "c:\data"
sURL = "http://www.pharmac.govt.nz/schedule/archive/README.html"
Set oXml = CreateObject("Microsoft.XMLHTTP")
oXml.Open "GET", sURL, False
oXml.sEnd
With CreateObject("ADODB.Stream")
.Type = 1 'binary
.Mode = 3 'adModeReadWrite
.Open
On Error Resume Next
Do
.write oXml.responseBody
Loop Until Err = 0
On Error GoTo 0
.savetofile sFilePath, 2 'adSaveCreateOverwrite
End With
End Sub