ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding an image to an Image control (https://www.excelbanter.com/excel-programming/436584-adding-image-image-control.html)

ordnance1[_2_]

Adding an image to an Image control
 
I would like to create a worksheet where I can store information on number
of items. Each row of the worksheet would store data on 1 item only, and the
last cell of data would contain a link to an image of the item
(C:\Users\Dad\Desktop\test.png).

What I can not figure out is how to create the code to display the image in
an Image control on my Userform.

What I tried was:

Image1.Picture = Range("E3").Value

where Range("E3") contained C:\Users\Dad\Desktop\test.png.

Is this do able? If so could someone point me in the right direction.


Peter T

Adding an image to an Image control
 
Image1.Picture = LoadPicture(Range("E3").Value)

Depending on the way you have things arranged you might need to do something
like

Worksheets("Sheet1").OLEObjects("Image1").Object.P icture =
LoadPicture(Range("E3").Value

Regards,
Peter T



"ordnance1" wrote in message
...
I would like to create a worksheet where I can store information on number
of items. Each row of the worksheet would store data on 1 item only, and
the last cell of data would contain a link to an image of the item
(C:\Users\Dad\Desktop\test.png).

What I can not figure out is how to create the code to display the image
in an Image control on my Userform.

What I tried was:

Image1.Picture = Range("E3").Value

where Range("E3") contained C:\Users\Dad\Desktop\test.png.

Is this do able? If so could someone point me in the right direction.





All times are GMT +1. The time now is 12:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com