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...
...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!
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>
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!