+ Reply to Thread
Results 1 to 3 of 3

LoadPicture from existing image/shape

  1. #1
    Registered User
    Join Date
    04-27-2010
    Location
    Louisville KY USA
    MS-Off Ver
    Excel 2003
    Posts
    25

    LoadPicture from existing image/shape

    I have about a dozen pictures that I have manually put into sheet 2. In sheet 1 I have a button that launches a user form that has nothing in it. I just want it to pop up and I want to dynamically change the background image (UserForm.Picture property) to one of the pictures from sheet 2. However, I don't have the file paths. I want this to all be self-contained. I have manually changed the names of the images so they're easy to remember and identify. I have tried doing something like this with no luck:

    MyUserForm.Picture = MyPictureControlName 'one of the 12 pictures
    MyUserForm.Show

    But this throws an error.

    LoadPicture is great, but requires a file path, which I don't have.

    Ideas?

    Thank you!

  2. #2
    Registered User
    Join Date
    04-27-2010
    Location
    Louisville KY USA
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: LoadPicture from existing image/shape

    Still strikning out here. It seems so simple that if an object has a property that IS a Picture object that you should be able to just say Object.PropertyThatIsAPicture = APictureObject But leave it to VB, right? It's especially odd because VB is usually so forgiving in syntax, loose data typing, etc.

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: LoadPicture from existing image/shape

    Check out the PastePicture example
    http://www.oaltd.co.uk/Excel/Default.htm
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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