Get product image from Aliexpress

eblack93

New Member
Joined
Oct 1, 2021
Messages
19
Office Version
  1. 2019
Platform
  1. Windows
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:
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:
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,216,743
Messages
6,132,462
Members
449,729
Latest member
davelevnt

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