+ Reply to Thread
Results 1 to 3 of 3

Picture in a form, can the source image be changed using VBA?

  1. #1
    Forum Contributor
    Join Date
    11-17-2009
    Location
    PA USA
    MS-Off Ver
    Excel 2000
    Posts
    184

    Question Picture in a form, can the source image be changed using VBA?

    I have a form with a picture object. I have five different pictures I want to show on the form, based on the value of a cell when the form is initialized.

    The five different pictures are located in cells in the same workbook.

    Is it possible to use VBA code to change the image being displayed in the picture object on the form?

    So far I have all five images on top of each other and then use [Visible = False] or [Visible = True] for each image as required, but maybe there is a better solution to this.
    Last edited by proepert; 03-18-2013 at 10:53 PM. Reason: Solved

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

    Re: Picture in a form, can the source image be changed using VBA?

    You can use a linked picture for a non vba solution.

    http://www.jkp-ads.com/Articles/ShowPicture00.asp
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    11-17-2009
    Location
    PA USA
    MS-Off Ver
    Excel 2000
    Posts
    184

    Re: Picture in a form, can the source image be changed using VBA?

    Thank you Andy, you have helped me often. I started with the linked picture solution, but the response is real slow. I have to change the data validation as well as the picture, and the combination is painfully slow even with screen updating toggled off.

    I have the form working. I just located each image in the same location on the form and toggle the visibility of them as required. A plus to using the form is the user can hide the form when they don't care to see the pictures.

    Thanks again so much for taking the time to reply to this thread.

+ 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