Quote Originally Posted by ByteMarks View Post
This will check for the folder and create it if necessary

 Private Declare Function URLDownloadToFile Lib "urlmon" _
    Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, _
    ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long

Sub download()
Dim lr As Long, r As Long
Dim FileToDownLoad$, NewFileName$, NewFilePath$


lr = Cells(Rows.Count, 1).End(xlUp).Row
For r = 2 To lr
    Application.StatusBar = r - 1 & " of " & lr - 1
    
    FileToDownLoad = Range("A" & r).Value
    NewFileName = Range("B" & r).Value & ".pdf"
    NewFilePath = Range("C" & r).Value
    If Len(Dir(NewFilePath, vbDirectory)) = 0 Then MkDir (NewFilePath)
    URLDownloadToFile 0, FileToDownLoad, NewFilePath & "\" & NewFileName, 0, 0
    DoEvents
Next
Application.StatusBar = False
End Sub
This code is working perfectly -- thank you.

One question though: How do I know where the code stops if there's an interruption? Is it safe to assume that this vba is stepping linearly down row by row such that if the last export was data from row 5789, I could safely assume that everything before row 5789 has been exported and everything 5790+ is un-exported? Problem is there's so much data and if my internet goes out (ex. end of work day before getting home) the macro stops and I have no idea where it last left off.

Thank you!