Forum Discussion

wpryan023's avatar
wpryan023
Copper Contributor
Dec 09, 2022

=Image returns a #connect error

Hi All, I'm experimenting with the new =Image function, and somehow I can't get it to work. I copied a file to my sharepoint site, set the permissions to "anyone can view". I copied the URL and pasted it into the workbook. If I click on the hyperlink, the file opens. However, if I insert the function =IMAGE(A1,,2) I get a #connect error. 

 

...any ideas?

...

  • dscheikey's avatar
    dscheikey
    Bronze Contributor

    wpryan023 

    You must use a link to the internet. A link to a cell does not work.

    Syntax

    =IMAGE(source, [alt_text], [sizing], [height], [width])

    source The URL path, using an "https" protocol, of the image file. Required. Supported file formats include BMP, JPG/JPEG, GIF, TIFF, PNG, ICO, and WEBP.

     

     

     

    =IMAGE("https://upload.wikimedia.org/wikipedia/commons/thumb/0/04/Eintracht_Frankfurt_Logo.svg/550px-Eintracht_Frankfurt_Logo.svg.png")

     

     

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor
    The IMAGE function may point to a cell containing a URL. I have a workbook with several hundred links in another sheet and IMAGE works with them with no issue. I show/hide images with a drop down.

    The #CONNECT error may be due to an unsupported file type or external content being blocked.
    Image supports: BMP, JPG/JPEG, GIF, TIFF, PNG, ICO, and WEBP..

    Details on external content:
    https://support.microsoft.com/en-us/office/block-or-unblock-external-content-in-office-documents-10204ae0-0621-411f-b0d6-575b0847a795
    • wpryan023's avatar
      wpryan023
      Copper Contributor
      Thanks for your reply. I tried with a picture from my company website and it's working. The pictures I want to link are on my SharePoint site. If I click directly on the link, then the picture opens normally in my browser, I just can't get it to open in the file...
  • amritshakya's avatar
    amritshakya
    Copper Contributor
    not working for me as well, looking forward for the issue to be resolved.
  • Hirandesilva1's avatar
    Hirandesilva1
    Copper Contributor

    wpryan023 

    For me the IMAGE formula works fine on one spreadsheet. I copied the (same) URL from there to another spreadsheet and it shows the CONNECT error.

    One works, the other doesn't!

    EDIT: SOLVED but this may help.

    The problem was, the image URL no longer worked. BUT, the old spreadsheet was still 'showing' the image! Even 'refreshing it when the IMAGE formulas were being re-entered in another cell with VBA.

    Looks like Excel is caching the image?

     

    • SergeiBaklan's avatar
      SergeiBaklan
      MVP

      Hirandesilva1 

      Excel caches practically everything what is taken from outside - rich data types, chart map, data in data model and in cached PivotTable. I'm almost sure images as well.

  • c_suren's avatar
    c_suren
    Copper Contributor

    wpryan023 

     

    This worked for me:

    • Open the spreadsheet from which you want to access the pictures using the IMAGE function and create an empty sheet
    • Go to the sharepoint site and find the folder where the images are hosted
    • Export the list of files to excel using the sharepoint menu
    • After opening the .IQY file, it's gonna ask where you want to download the data to. Select "existing sheet" or something like that, and select a cell in the empty sheet you created before.

    From now on, this Excel file will be able to access the SharePoint site you queried with the .IQY file because you literally created a connection to SharePoint from within the excel workbook.