Converting a Image URL to Actual Image Size

ahobbs01

New Member
Joined
Jan 13, 2023
Messages
16
Office Version
  1. 365
Platform
  1. Windows
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.
1684787484951-png.92080

1684787461568-png.92079
 
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)
1684954579400.png


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
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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.
 
Upvote 0

Forum statistics

Threads
1,215,521
Messages
6,125,303
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

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.
Go back
Back
Top