How to Insert picture to user form a url in Excel cell.?

Anonymous
2018-05-30T08:52:06+00:00

Hi Everyone

I am looking for the answer for How to Insert picture to a user image area form a url in Excel cell.?

Both the excel sheet and user form screenshots are given below.

Please help me.

Thanks

Shozib

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Andreas Killer 144K Reputation points Volunteer Moderator
    2018-06-02T08:00:27+00:00

    Image controls support only one format: StdPicture (which is a data structure in memory).

    LoadPicture convert the picture into that data structure. LoadPicture support bmp gif ico wmf, most jpg and a few older file formats.

    If you want to load png or tif you have to use GdiPlus... A lot of code, e.g.

    http://www.vbarchiv.net/tipps/tipp\_1264-ersatz-fuer-die-vb6-loadpicture-funktion.html

    Andreas.

    1 person found this answer helpful.
    0 comments No comments
Answer accepted by question author
  1. Andreas Killer 144K Reputation points Volunteer Moderator
    2018-05-30T18:08:48+00:00

    I have downloaded the pics. . Now the pics are in cells in Excel.

    Why? The code of the mentioned website shows how to download a picture and load it into the image control.

    Furthermore, pictures can not be loaded into cells in Excel... if you import a picture into Excel the picture becomes a shape. Useless.

    Anyway if you have the file on your disk, use LoadPicture to load the file into the image control.

    Andreas.

    Private Sub UserForm_Initialize()

      Me.Image1.Picture = LoadPicture("C:\whatever\test.bmp")

    End Sub

    1 person found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Andreas Killer 144K Reputation points Volunteer Moderator
    2018-05-30T10:18:42+00:00

    You have to download the picture first, then you can load it as usual:

    http://www.vb-helper.com/howto_download_url_to_file.html

    Andreas.

    0 comments No comments
  2. Anonymous
    2018-05-30T17:42:47+00:00

    Thanks for your reply. I have downloaded the pics. . Now the pics are in cells in Excel. Could you please tell me how can I now load a specific pic into user form??

    0 comments No comments
  3. Anonymous
    2018-06-01T18:53:17+00:00

    Thankyou so much

    0 comments No comments