+ Reply to Thread
Results 1 to 5 of 5

Load picture in Userform from images in the same workbook.

  1. #1
    Registered User
    Join Date
    07-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Load picture in Userform from images in the same workbook.

    Hi,

    Im very new to this forum and can someone help me with this task.

    I have a workbook with images and have created a userform using VBA in the same.

    I wanted to load a picture in the userform from the images on sheet 3.

    Any help is greatly appreciated.Thanks in advance.

    regards,
    Prakash

  2. #2
    Forum Contributor
    Join Date
    07-27-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    198

    Re: Load picture in Userform from images in the same workbook.

    VBA code in Module1 in the attached Excel 2003 file will allow you to copy
    an embedded image in the workbook to the clipboard. The image can then be pasted
    into the form's image control.

    The developer of this code is documented in Module1.

    I added the form and images to demonstrate that it works. Image selection is
    controlled in the combo list change event.

    If you decide to use this solution, as you test it, you may want to ensure
    that a copied image is no longer in the clipboard after the application is closed.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Load picture in Userform from images in the same workbook.

    Helloe,

    First of all thank you so much for taking time to help me with such elaborate reply and an example file.

    But is there any option without using a combo list box this can be done?

    Because i have created a userform as a tool for my company to access different hyperlinks linked to a command button.

    I would like to create a picture box beneath to have images keep changing as they work on other controls in the userform ( like a advertisement board) where the images of company will be saved in the excel sheet and it keeps changing with a specified time interval.To make imges change with specific time interval i ve done it with " kernel32" library. only thing i want to do is to have images load into the picture box and keep changing.

    I tired this code but not working.

    Me.userform2.picture1 = loadpicture(thisworkbook.worksheets("Sheet2").shapes("logo"))

    Thanks in advance for your help.
    Regards,
    Prakash.

  4. #4
    Forum Contributor
    Join Date
    07-27-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    198

    Re: Load picture in Userform from images in the same workbook.

    I can't help you much more than with the example I've given you. If this were my task, I would
    research using a timer for Windows applications. I’ve never used a timer in Excel, although I did
    use it in Visual Basic courses. You would use the timer to periodically execute code similar to the
    code in my example combo change event, but coded to cycle through your available images.

  5. #5
    Registered User
    Join Date
    07-01-2014
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    1

    Re: Load picture in Userform from images in the same workbook.

    Man, that solution was pretty awesome.

    I'm stil trying to understand what you did, however, I'm still capable of making it works!

    Thanks Man! You're Awesome³³³!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1