View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Image Control Question

Just so you are aware, I tested the code before I posted it and it worked
fine here on my XL2003 system. If you are getting a crash, then something
other than the Set statement is causing it.

--
Rick (MVP - Excel)


"kirkm" wrote in message
...
On Mon, 22 Sep 2008 10:45:55 -0400, "Rick Rothstein"
wrote:

Put this statement in the (General)(Declarations) section of the
UserForm's
code window...

Dim OriginalPicture As StdPicture

Then put this in the UserForm's Initialize event...

Set OriginalPicture = Image1.Picture

Now, whenever and wherever you want to restore the original picture for
the
Image1 control, just execute this statement...

Set Image1.Picture = OriginalPicture


Thanks Guys, I've spent quite a long time trying to achieve this and
have concluded it's just not worth it ! The 'Set" command seems to
cause Excel to crash with that 'Sorry for the inconvieniance' thing.
Then it spends hours recovering....

The simplist fix is not have any default image and create the required
one each time. Problem gone.

My original theory seemed Ok: if the image exists, use it
otherwise use the default - but too much hassle !

Thanks for the suggestions and help though.
Cheers - Kirk