- Excel VBA 質問スレ Part44 [無断転載禁止]©2ch.net
292 :デフォルトの名無しさん[sage]:2016/12/03(土) 12:22:23.11 ID:MyQ8FskT - >>284
切り貼りして作ってみた 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 test() Dim SaveFileName As String Dim DownloadFile As String Dim Ret As Long Dim P As Object SaveFileName = "C:\○○○.jpg" DownloadFile = "http://〜/△△△.jpg" Ret = URLDownloadToFile(0, DownloadFile, SaveFileName, 0, 0) DoEvents If Ret = 0 Then MsgBox "ダウンロードできました。" Set P = LoadPicture("C:\○○○.jpg") MsgBox CLng(P.Width * 0.0378) & " × " & CLng(P.Height * 0.0378) Else MsgBox "エラーが発生しました。" End If End Sub
|