Search code examples
excelvbauserform

Set the value of an image control in the user form by referencing a file path


To avoid having to store images in the workbook itself, or to first load the image into the workbook and then reference those images from a userform, is there a way to set the image value from a userform image control to a specific filepath?

Something like:

image_server.show
set image_server.image_control_name = "C:\Users\user_name\Desktop\images\island.jpg"

Solution

  • Apparently it's simply:

    image_server.Picture = LoadPicture(filepath)