Hi, I have a table with a list of URLs that I need to get the picture for. Each URL opens the product webpage but I've been trying using Query and VBA to get the product image for each URL. Is this something realistic?
The macro would run but after about 10 mins it came up with an error and the images inserted were only "Couldn't get image" Here is the code I was using:
I also want to note that the links I'm using are like the ones below:
The macro would run but after about 10 mins it came up with an error and the images inserted were only "Couldn't get image" Here is the code I was using:
VBA Code:
Sub InstallPictures()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim url_column As Range
Dim image_column As Range
'column with url...
Set url_column = Worksheets(1).UsedRange.Columns("C")
'column where image will be inserted
Set image_column = Worksheets(1).UsedRange.Columns("B")
Dim i As Long
For i = 2 To url_column.Cells.Count
Set Picture = image_column.Worksheet.Pictures.Insert(url_column.Cells(i).Value)
Picture.Left = image_column.Cells(i).Left
Picture.Top = image_column.Cells(i).Top
Picture.Height = 40
image_column.Cells(i).EntireRow.RowHeight = 40
Next
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
I also want to note that the links I'm using are like the ones below: