Picture.insert in excel 2010

ChristineMD

Board Regular
Joined
Jul 29, 2008
Messages
53
Found this nifty piece of code out on the webs to display pictures from urls in excel. When I run it I get the following error: runtime error 1004, unable to get the insert property of the picture class

Further googling shows this as an issue in excel 2007 that was fixed in excel 2010 which is what I have. Any other ideas?

Example of url from column a:


HTML:
<img src="http://cdn.yourzoom.com/up/01269.set/188w.jpg">


vb code:

Code:
Sub pix()
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
End Sub

thanks in advance - this forum has always been so helpful!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
your code works, but you have to put in column A urls like

http://cdn.yourzoom.com/up/01269.set/188w.jpg
not
HTML:
<img src="http://cdn.yourzoom.com/up/01269.set/188w.jpg">

 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,157
Messages
6,129,195
Members
449,493
Latest member
JablesFTW

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