title: Download .csv from an indirect Asana link
body: <p>This code creates a download but not of the linked file as it is not direct. When I open the .csv file it downloads, it appears to be the data from the redirect, not the file linked to the redirect.</p>
  
  <p>This is the code:</p>
  
  <pre><code>Sub Asana()
  
  Dim myURL As String
  myURL = "https://app.asana.com/-/csv?id=955497629707333"
  
  Dim HttpReq As Object
  Set HttpReq = CreateObject("Microsoft.XMLHTTP")
  HttpReq.Open "GET", myURL, False, "username", "password"
  HttpReq.send
  
  
  myURL = HttpReq.responseBody
  If HttpReq.Status = 200 Then
      Set oStrm = CreateObject("ADODB.Stream")
      oStrm.Open
      oStrm.Type = 1
      oStrm.Write HttpReq.responseBody
      oStrm.SaveToFile ThisWorkbook.Path &amp; "\" &amp; "SER_Backlog_BRCC.csv", 2 ' 1 = no overwrite, 2 = overwrite
      oStrm.Close
  End If
  
  End Sub
  </code></pre>
  
  <p>It should be a spreadsheet copy of the data on the page, but it comes out with data in a spreadsheet of the website and not the linked .csv file you would get, if done manually.</p>
  
  <p><a href="https://i.stack.imgur.com/Xybhy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Xybhy.png" alt="DOCHTML"></a></p>
  
  <p>Should be this:</p>
  
  <p><a href="https://i.stack.imgur.com/112Vv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/112Vv.png" alt="should be this"></a>.</p>