Reference an image in another sheet

  • Thread starter Thread starter Pete Csiszar
  • Start date Start date
P

Pete Csiszar

Hi All,

I need a little help referencing a GIF image on another another work sheet.
Basically what I'd like to do is have a UserForm display a GIF image that is
located in Sheet2

I've got a CommandButton in Sheet1 that opens UserForm1, which is setup for
an image but I'm having trouble getting the image Picture1 located in Sheet2
to display in the form.

I know it is an addressing issue but I'm not sure how to reference it.
If I was calling a GIF file with a path, this wouldn't be a problem.

TIA.

Pete
 
Pete,

I'm assuming you need to load the picture at runtime. I struggled with the
same thing a few months ago and could not get the syntax. I tried something
like Image1.Picture = thisworkbook.worksheets("birds").shapes("birds1"), but
it didn't work, and nobody in this group responded with any syntax.
Somebody in this group suggested storing the images in the userform and
that's what I did. I put the images on the right side of the userform and
then set the right margin so that they were beyond it. Increased the size
of the file, but it worked.

hth,

Doug

If
 
Thanks for having a look Doug. You maybe right, I might have to store the
images in the UserForm.

Regards,
Pete
 
Pete,

I think you have two options.

1. copy the image into a graph, export the graph as a gif, import the gif
file back into your other workbook. There's something on j-walk about that
method.

2. use Stephen Bullen's paste picture routine. copy the image to the
clipboard from the first sheet, paste it back from the clipboard using paste
picture. It's a bit complicated at first, but it is massively faster and
more elegant.
http://www.bmsltd.co.uk/Excel/Default.htm

Robin Hammond
www.enhanceddatasystems.com
 
Back
Top