Forum Discussion
Michael Lovice
Jan 04, 2019Copper Contributor
Convert image url to actual image in excel
I have a column of image URLs in my workbook and would like to show the actual image in the next column. Is there a formula or add in that can be used?
- bitsolCopper ContributorHI All
bellow code I'm using but not getting the actual result from goto lab line move in end
Sub URLPictureInsert()
'Updateby Extendoffice 20161116
'Update by Haytham 20180104
Dim Pshp As Shape
Dim xRg As Range
Dim xCol As Long
On Error Resume Next
Application.ScreenUpdating = False
Set Rng = ActiveSheet.Range("d2:d140")
For Each cell In Rng
filenam = cell
ActiveSheet.Pictures.Insert(filenam).Select
Set Pshp = Selection.ShapeRange.Item(1)
If Pshp Is Nothing Then GoTo lab
xCol = cell.Column + 1
Set xRg = Cells(cell.Row, xCol)
With Pshp
.LockAspectRatio = msoFalse
.Width = 60
.Height = 30
.Top = xRg.Top + (xRg.Height - .Height) / 2
.Left = xRg.Left + (xRg.Width - .Width) / 2
End With
lab:
Set Pshp = Nothing
Range("d2").Select
Next
Application.ScreenUpdating = True
End Sub - Tpollock33Copper Contributor
I know this is an older thread, but does anyone know how to change this VBA to populate the pictures in the cell below instead of to the right?
- Haytham AmairahSilver Contributor
Hi Michael,
No formula can help in this regard!
You need a VBA code or a third-party add-in to view these images.
Please check out this link.
Hope that helps
- MSDON25Copper ContributorHi Haytham,
Is there a easy way to do this for a row instead of a column?
ie. a range of image URLs from B2 to M2 and to show the image beneath it at C2 to M2?
I'm not too familiar with VBA but couldn't get the VBA to work when I changed the columns to rows and rows to columns in the code.
Thank you,
Michael - KolianilCopper Contributor
- rsinghal2019Copper Contributor
Hi, I have a file having one column consist of many URLs and in next column I wish to convert these URLs into real images. I am using office 2007. Please find the file as attached. Kindly help me to convert this file . Looking forward.
Haytham Amairah wrote:Hi Michael,
No formula can help in this regard!
You need a VBA code or a third-party add-in to view these images.
Please check out this link.
Hope that helps
- Haytham AmairahSilver Contributor
Hi rsinghal2019,
It seems that the links in the file aren't valid when you open them in the browser!
Therefore, I don't think that the solution is applicable to them.