I am using the following code to download a .xlsx file from web on Excel VBA.
Sub Download()
Const MYURL = "https://www.arembepe.net/temp/COMDINHEIRO_gabrielzancheta749999241.xlsx"
Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
objHTTP.Open "GET", MYURL, False
objHTTP.Send
Set oStream = CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = 1
oStream.Write objHTTP.ResponseBody
oStream.SaveToFile ("C:\wamp\file.xlsx")
oStream.Close
End Sub
The code succeeds to download the file and saves it in the directory. But instead of saving it I wish I could open the xlsx file on Excel. Is it possible?