-7

I have a worksheet with folder names and image urls. I want to download all the image to the specific folder.

enter image description here Anyone have any idea how to do it? Thank you

Spechal
  • 2,634
  • 6
  • 32
  • 48
JaCk Lee
  • 1
  • 1
  • Hi Spechal, I have no any programming knowledge and background.don't know how to do it. – JaCk Lee Dec 24 '16 at 09:38
  • Possible duplicate of [Inserting an Online Picture to Excel with VBA](http://stackoverflow.com/questions/16113876/inserting-an-online-picture-to-excel-with-vba) – Rehban Khatri Dec 24 '16 at 09:46
  • Hi Rehban Khatri, I want it to download to my PC, not in excel – JaCk Lee Dec 24 '16 at 09:58
  • 3
    "I have no any programming knowledge and background." So you cannot do this your self without getting this `VBA` programming knowledge first. But this site is not a site for teaching programming. But you could doing a web-search about `download picture from url list in excel`. -> http://tipsformarketers.com/use-excel-to-download-hundreds-of-images-instantly/. – Axel Richter Dec 24 '16 at 10:15

1 Answers1

0

Try this and see how you get along.

Sub ExportAllPictures()
    Dim MyChart As Chart
    Dim n As Long, shCount As Long
    Dim Sht As Worksheet
    Dim pictureNumber As Integer

    Application.ScreenUpdating = False
    pictureNumber = 1
    For Each Sht In ActiveWorkbook.Sheets
        shCount = Sht.Shapes.Count
        If Not shCount > 0 Then Exit Sub

        For n = 1 To shCount
            If InStr(Sht.Shapes(n).Name, "Picture") > 0 Then
                'create chart as a canvas for saving this picture
                Set MyChart = Charts.Add
                MyChart.Name = "TemporaryPictureChart"
                'move chart to the sheet where the picture is
                Set MyChart = MyChart.Location(Where:=xlLocationAsObject, Name:=Sht.Name)

                'resize chart to picture size
                MyChart.ChartArea.Width = Sht.Shapes(n).Width
                MyChart.ChartArea.Height = Sht.Shapes(n).Height
                MyChart.Parent.Border.LineStyle = 0 'remove shape container border

                'copy picture
                Sht.Shapes(n).Copy

                'paste picture into chart
                MyChart.ChartArea.Select
                MyChart.Paste

                'save chart as jpg
                MyChart.Export Filename:=Sht.Parent.Path & "\Picture-" & pictureNumber & ".jpg", FilterName:="jpg"
                pictureNumber = pictureNumber + 1

                'delete chart
                Sht.Cells(1, 1).Activate
                Sht.ChartObjects(Sht.ChartObjects.Count).Delete
            End If
        Next
    Next Sht
    Application.ScreenUpdating = True
End Sub
ASH
  • 20,759
  • 19
  • 87
  • 200