Leonvl
New Member
- Joined
- Apr 26, 2016
- Messages
- 20
I uded the below code to insert pictures based on a URL on the web based on a cell value which worked fine.
Now I would like to insert pictures for a range from a local folder, but that apparently doesnt work with the Parent.Pictures.Insert method. Played a bit with the Shapes.AddPicture method but cant get it working. Any thoughts here? Thanks
Now I would like to insert pictures for a range from a local folder, but that apparently doesnt work with the Parent.Pictures.Insert method. Played a bit with the Shapes.AddPicture method but cant get it working. Any thoughts here? Thanks
Code:
Sub InsImg()
Dim URL As Range
For Each URL In Worksheets("Sheet1").Range("A4:ZZ4")
With URL.Parent.Pictures.Insert(URL.Value)
On Error Resume Next
.Left = URL.Offset(0, 0).Left + 1
.Top = URL.Offset(0, 0).Top
.Height = 250
' .Width = 420
URL.EntireRow.RowHeight = .Height
End With
Next
End Sub