# Convert Url to Images in Excel



## 29sandesh (Jan 30, 2019)

Hi Team, I have a list of 300 urls in column A, I need their images to reflect in column B with given dimensions e.g 50px x 50px. Can you please help me with a VBA code for the same. Its excel 2007. 

Column A                                                                                     | Column B

https://i.ebayimg.com/images/g/STIAAOSwmSZbPllK/s-l500.jpg

<tbody>

</tbody>


----------



## John_w (Jan 30, 2019)

Try the macro at https://www.mrexcel.com/forum/excel...play-images-urls-post3430135.html#post3430135


----------



## 29sandesh (Jan 30, 2019)

John_w said:


> Try the macro at https://www.mrexcel.com/forum/excel...play-images-urls-post3430135.html#post3430135



Getting Error below, I believe its due to old excel or something, i read need to insert shape something function.

Run-time error '1004'


Insert method of Pictures class failed


----------



## Kenneth Hobson (Jan 30, 2019)

For my macro, first, manually resize a pic (I used Paint) and then resize the column and row for B2.


```
Sub Main()
  Dim r As Range, s As Shape
  With Worksheets("Sheet1")
    For Each r In .Range("A2", .Cells(Rows.Count, "A").End(xlUp))
      .Pictures.Insert(r.Value).Select
      With Selection.ShapeRange.Item(1)
        .Left = r.Offset(, 1).Left
        .Top = r.Offset(, 1).Top
        .Height = r.Parent.Rows(2).Height
        r.RowHeight = .Height
      End With
    Next r
    .[A1].Select
  End With
End Sub
```


----------



## 29sandesh (Jan 31, 2019)

Kenneth Hobson said:


> For my macro, first, manually resize a pic (I used Paint) and then resize the column and row for B2.
> 
> 
> ```
> ...



Sorry but getting below error

Unable to get the Insert property of the Picture Class


----------



## Kenneth Hobson (Jan 31, 2019)

The link is by formula or a pasted value that turns into a link? I used the latter.

My example: https://www.dropbox.com/s/olorludn9bktuzg/InsertFromURLAndResize.xlsm?dl=0


----------

