Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing what is displayed in an image control programatically
I inserted an image control into an worksheet from the Control toolbox, and I want
to be able to change the picture programmatically. If I put "Image1.Picture = LoadPicture("C:\pictures\picture1.jpg") into the Image1_click() event, then it loads the picture when I click the image. However, what I have is a list of possible pictures in the worksheet (i.e. cell A1 says "C:\pictures\picture1.jpg", A2 says "C:\pictures\picture2.jpg" etc). What I want is to be able to pass a variable, row_no, into a normal subroutine (i.e. not an event procedure), so that it loads the relevant picture into the image. But I get an error message. This is what I have tried: a$ = Worksheets("Data").Range("a" & row_no).text Worksheets("Display").Shapes("Image1").Picture = LoadPicture(a$) What am I doing wrong? Thanks for any help Eric Kehr |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Image not displayed when the physical file is N/A | Excel Discussion (Misc queries) | |||
Changing font color of protected cells programatically | Excel Discussion (Misc queries) | |||
How to programatically control a 3D-sum? | Excel Worksheet Functions | |||
Trouble with Image Control on a worksheet | Excel Worksheet Functions | |||
Click on Image Control disables it | Excel Programming |