Image Control
Somehow you need to keep track of which picture was loaded last. I'm
not sure if you can get this information from the object, so it might
be necessary to keep it in a cell. What I'm getting at is that when
your code says:
Dim i as Integer
i = i + 1
The second line assumes taht i was 0. You actually need to set i to
the last loaded picture. Maybe you could place it in a cell
underneath the picture and do something like this:
sub ChangePic ()
Dim i as Integer
i=activesheet.cells(2,2).value
i = i + 1
activesheet.cells(2,2).value = i
Me.Image1.Picture = LoadPicture(""C\My Documents\Pictures\My Pic " &
i
& ".bmp")
End Sub
|