Insert image from URL into a spreadsheet

Einar Husabø 0 Reputation points


I have problems inserting images into an Excel sheet from a URL address.

I can of course use the formula =IMAGE(A1,,3,150) and the URL is in Cell A1.

The problem then becomes that the image itself is in the cell and can make the spreadsheet very difficult to store if there are many images.

I have previously used a macro that works if I point to a jpg file or similar, but it does not work on the URL address below.

While this one, on the other hand, works fine.

How do I solve this when the URL is put in column J as in this case?

Private Sub Test_1()

   Dim rCell As Range

    Dim newFileName As String

    Dim vntBilde As Variant

    Dim Svar As Integer


    Set rCell = Range("b10")

    Do While rCell.Row > 1

    If rCell.Value = "" Then Exit Do

    newFileName = rCell.Offset(0, 8).Range("a1")

    rCell.Offset(0, 1).Range("a1").Select

    On Error Resume Next


    Selection.ShapeRange.ScaleWidth 0.45, msoFalse, msoScaleFromTopLeft

    Selection.ShapeRange.ScaleHeight 0.45, msoFalse, msoScaleFromTopLeft


    rCell.Offset(1, 0).Range("a1").Select

    Set rCell = Selection(1, 1)



If rCell.Value = "" Then Exit Do


End Sub
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,673 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,700 questions
0 comments No comments
{count} votes