I used this code from another VBA question thread but I received an error. I am trying to extract the image from the URL without changing the size of the image.It worked for some of the images but then errored out.
I am getting the error "Unable to get the Insert property of the Picture class" I think it is because I have some URLs that contain videos. Is there a way to get the video in Excel or to skip that row with an IF statement like above? The debug is showing the error for "With URL.Parent.Pictures.Insert(URL.Value)
VBA Code:
Sub InsImg()
Dim URL As Range
For Each URL In Range("E2", Cells(Rows.Count, "E").End(xlUp))
With URL.Parent.Pictures.Insert(URL.Value)
.Left = URL.Offset(0, 1).Left
.Top = URL.Offset(0, 1).Top
If .Height <= 408 Then
URL.EntireRow.RowHeight = .Height
End If
End With
Next
End Sub
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.
Be sure to follow & read the link at the end of the rule too!
Cross posted at: Converting Image/Video URL to Actual Image Size
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.
If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.