I am sorry if the code above is not visible. Please refer to the following.
(Code begins)
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://www.website.com"
While IE.Busy
Wend
IE.Document.All.Item("user").Value = "Password"
IE.Document.All.Item("pass").Value = "Username"
IE.Document.All.Item("loginButton").Click
While IE.Busy
Wend
strFileURL = IE.document.links(1) ‘*problem*
strHDLocation = "C:\Documents and Settings\aharvey\Desktop\data\New.wav"
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
objXMLHTTP.open "GET", strFileURL, false
objXMLHTTP.send()
If objXMLHTTP.Status = 200 Then
Set objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open
objADOStream.Type = 1
objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0
Set objFSO = Createobject("Scripting.FileSystemObject")
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
Set objFSO = Nothing
objADOStream.SaveToFile strHDLocation
objADOStream.Close
Set objADOStream = Nothing
End if
Set objXMLHTTP = Nothing
(Code ends)
I was unable to edit the main post.