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 'API宣言 Sub sample() Dim i As Integer Dim folder As String Dim url As String
folder = "C:\test\" '保存フォルダ(最後は\に) For i = 1 To 74 url = Cells(2 * i + 2, 1) file = Mid(url, InStrRev(url, "/") + 1) & ".pdf" 'ファイル名(urlの最後の"/"の後ろ(???.pdf)) URLDownloadToFile 0, url, folder & file, 0, 0 'ファイルダウンロード Next End Sub -----ここまで