×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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\blabla\
Instead 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.

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

@Fabien

this is not really a CATIA question, you should try https://stackoverflow.com/ for programming help

Eric N.
indocti discant et ament meminisse periti

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

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources