+ Reply to Thread
Results 1 to 6 of 6

Load picture into form not using 'LoadPicture'

  1. #1
    Registered User
    Join Date
    09-29-2008
    Location
    Toronto, Canada
    Posts
    14

    Load picture into form not using 'LoadPicture'

    How would I load a picture into an image control box in a form not using 'LoadPicture' from a file in a directory but taking an image/picture already embedded in another worksheet?
    I'm talking about using a macro to do this, not the direct method of going into the Properties in the VBA editor.

    Thanks.
    Last edited by pfrattali; 12-31-2010 at 11:37 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Load picture into form not using 'LoadPicture'

    Hello pfrattali,

    Copy the image using CTRL+C. Open the VB Editor (ALT+F11). Click on the image control. In the Properties window, Find Picture. Click the box the to the right and use CTRL+V to paste the image.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    09-29-2008
    Location
    Toronto, Canada
    Posts
    14

    Re: Load picture into form not using 'LoadPicture'

    Quote Originally Posted by Leith Ross View Post
    Hello pfrattali,

    Copy the image using CTRL+C. Open the VB Editor (ALT+F11). Click on the image control. In the Properties window, Find Picture. Click the box the to the right and use CTRL+V to paste the image.
    How do I do this using a macro? I want to be able to variably add different pictures when the Form is activated or shown.

  4. #4
    Registered User
    Join Date
    09-29-2008
    Location
    Toronto, Canada
    Posts
    14

    Re: Load picture into form not using 'LoadPicture'

    How do load a picture that's in the clipboard into the image control box of a Form, using a macro?
    Hope this helps to better understand what I'm looking for.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Load picture into form not using 'LoadPicture'

    Hello ,

    This a lot of code for one macro that will paste what is on the clipboard into the Image object. Fortunately, it is very easy to use. Copy and paste the macro code into a separate VBA module in your workbook.

    Example of Using the Macro
    Please Login or Register  to view this content.


    Macro Code to Paste Picture from Clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Load picture into form not using 'LoadPicture'

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

+ 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