VBA download form URL with login that redirect to another one
问题 the website requires login then redirect you to other url then download the file this function works fine with url with no redirction but not with my case Function DownloadFile(URL As String, Path As String, UserName As String, Password As String) As Boolean DownloadFile = False Dim WinHttpReq As Object Set WinHttpReq = CreateObject("MSXML2.ServerXMLHTTP.6.0") WinHttpReq.Open "GET", URL, False, UserName, Password WinHttpReq.send Set oStream = CreateObject("ADODB.Stream") oStream.Open oStream