title: Excel VBA how to read in text file from web (not cached)?
body: <p>I have been using the following code to read in a text file from the web:</p>
  
  <pre><code>'import the text file into a string
  Function DownloadTextFile(URL As String) As String
  On Error GoTo Err_GetFromWebpage
  
  Dim objWeb As Object
  Dim strXML As String
  
   ' Instantiate an instance of the web object
  Set objWeb = CreateObject("Microsoft.XMLHTTP")
  
   ' Pass the URL to the web object, and send the request
  objWeb.Open "GET", URL, False
  objWeb.send
  
   ' Look at the HTML string returned
  strXML = objWeb.responseText
  
  DownloadTextFile = strXML
  
  
  End_GetFromWebpage:
   ' Clean up after ourselves!
  Set objWeb = Nothing
  Exit Function
  
  Err_GetFromWebpage:
   ' Just in case there's an error!
  MsgBox Err.Description &amp; " (" &amp; Err.Number &amp; ")"
  Resume End_GetFromWebpage
  
  End Function
  </code></pre>
  
  <p>It worked fine the first time, but when I make changes to the text file, it's not being reflected in the returned string. It's as if Excel is caching the file. What can I do to fix this? Thanks!</p>