Basically I am writing a code that grabs image urls from a list, and outputs their size in a cell. It works for some of the links but not all. Could someone tell me why it is so?
Dim MyPic As Shape
Dim sht As Worksheet
Set sht = ActiveSheet
With sht
For i = 2 To .Cells(.Rows.Count, "A").End(xlUp).Row
If .Cells(i, 2) <> "" Then
Set mypict = ActiveSheet.Shapes.AddPicture(.Cells(i, 2).Text, _
msoFalse, msoTrue, 3, 3, -1, -1)
'Set mypict = ActiveSheet.Pictures.Insert(.Cells(i, 2).Text)
.Cells(i, 7) = mypict.Width & " x " & mypict.Height
mypict.Delete
End If
Next i
End With
Best regards,
Francisco