Render HTML Link as Image

cowboyish1

New Member
Joined
Jan 15, 2016
Messages
5
Hello all. First off, I'm not a programmer. I LOVE Excel and Access, but I am completely self-taught, and I shoot from the hip until I can get things to work as I want.

I've been searching the internet, trying to find the answer for rendering an html path to a local folder on my computer to the actual image that the path represents. I have the html path in Column A (called PhotoPath) and I'd like the image to be rendered in Column B (called Photo). My workbook is called Crystal_Specimens, and the worksheet is called Details.

The most promising code I've found so far is this...
<code>Dim url_column As Range
Dim image_column As Range

Set url_column = Worksheets(1).UsedRange.Columns("A")
Set image_column = Worksheets(1).UsedRange.Columns("B")

Dim i As Long
For i = 1 To url_column.Cells.Count

With image_column.Worksheet.Pictures.Insert(url_column.Cells(i).Value)
.Left = image_column.Cells(i).Left
.Top = image_column.Cells(i).Top
image_column.Cells(i).EntireRow.RowHeight = .Height
End With

Next</code>

...but I could not get it to work. I received several errors abut the Set url and Set image lines. Perhaps I don't know what parts of the code I actually need to change/customize to my specific project.

At any rate, if anyone could help me, it would be greatly appreciated. Thanks much!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Can anyone assist me with this? I'm desperate. I'm not married to the code I supplied as an example. Any ideas will be appreciated. :)
 
Upvote 0
Well. DRAT! It seems the code just keeps looping, and the images are not able to be saved as part of the Excel workbook.
 
Upvote 0
Well. DRAT! It seems the code just keeps looping, and the images are not able to be saved as part of the Excel workbook.

Seems patience IS a virtue. It apparently takes a good while for all of the images to be inserted into the Excel document. If I'm patient and wait it out, the process DOES complete and does not loop.

Thanks for helping me with this...and for accommodating my novice status. :)
 
Upvote 0

Forum statistics

Threads
1,216,163
Messages
6,129,223
Members
449,495
Latest member
janzablox

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