Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Macro to insert image in a userform (Calling the images from the worksheet itself)

Status
Not open for further replies.

FabienF

New member
Joined
Jul 5, 2017
Messages
19
Location
FR
Hello,
I am trying to display an image on a userform depending on the choice of a combo box and the code below works fine:

picturename = "S:blablablabalabalab\blabla\" & name & ".jpg"
Userform.Image.Picture = LoadPicture(picturename)

However, I would like to avoid referring to the location S:blablablabalabalab\blablaInstead I would like to retrieve the image from an Excel worksheet itself (that I would hide afterwards).
In fact, the macro I am implementing will be used by several users on different computers, thus creating potential errors if they don't have access to that specific location (S:blablablabalabalab\blabla\)

Is there any way to that? call the images from the images from the worksheet itself?

Thanking you for your help in advance.
 
Thank you tesak for your quick response.
Indeed it is too complicated to use WIN API for my case.
As I had only 15 images to choose with the combobox, I decided to do differently:
I created 15 images control in the userform which are therefore overlapped and I copy/pasted ( picture property) my pictures in each one of them.
This method works fine and the images are saved in the Workbook itself.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top