Hey Friend
I want to download image from URL and resize automatically , any ideas ?
I want to download image from URL and resize automatically , any ideas ?
VBA Code:
Option Explicit
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
Dim Ret As Long
Sub Sample()
Dim ws As Worksheet
Dim LastRow As Long, i As Long
Dim strPath As String
Dim DirFile As String
Dim Path As String
Dim X As Integer
Dim FolderName As String
Set ws = Sheet1
FolderName = "C:\try"
LastRow = ws.Range("A" & Rows.Count).End(xlUp).Row
For i = 4 To LastRow
For X = 19 To 27
If Sheet1.Cells(i, X).Value <> "" Then
strPath = FolderName & "\" & i - 3 & "-" & X - 18 & ".jpg"
Ret = URLDownloadToFile(0, Sheet1.Cells(i, X).Value, strPath, 0, 0)
End If
Next X
Next i
End Sub