Download to file and readystate = 4
<p>I'm trying to write a code to download a very large file that, depending on bandwidth, may take 30 minutes to download.  I have a very basic script now, that typically terminates before the file is completely downloaded.  Is there a way to use readystate, or something similar, to make VBA allow the entire file to download before moving on?</p>

<p>Here's the code:</p>

<pre><code>Sub Download()
    Dim strURL As String
    Dim strPath As String

    '~~&gt; URL of the Path
    strURL = "http://www.aeronav.faa.gov/upload_313-/terminal/DDTPPE_201612.zip"
    '~~&gt; Destination for the file
    strPath = "c:\Users\username\Desktop\WebTest\database.zip"

    Ret = URLDownloadToFile(0, strURL, strPath, 0, 0)

End Sub
</code></pre>

<p>Thanks!</p>