VBA Excel: Insert an Image into a UserForm

phileas1412 Posted messages 7 Status Member -  
 Eric_paris -
Hello,

I'm looking to insert an image that is in an Excel file into a userform at the "image" frame level. This operation should be triggered from a combobox, so that the images change as you click on a name in the combobox.

Do you have a solution???
Thank you in advance
Phileas1412
Configuration: windows xp pro excel 2000

2 answers

Eric_paris
 
Create your photos in JPG format (via Microsoft Photo Editor)
Place your photos in a directory that you have previously created (c:\rep\ss_rep\photos\).

Use the following macro (Combobox1_click):

photo_path = "C:\rep\SS_rep\Photos\"
photo_name = Userform1.combobox1.value
full_name = photo_path & photo_name & ".jpg"
UserForm1.Frame1.Picture = LoadPicture(full_name)

The values you display in your Combobox1 must correspond to the names of the JPG files you have created, without the .JPG extension.
10
G.David Posted messages 790 Status Member 203
 
Type "veriti" in Google
The first site at the top of the list is Veriti 2.3, a Ti program that puts images in USFs if that suits you
Sincerely
G.David
--
Respect is not a given
It is earned
-2