Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shapes referencing -- external image 1

Status
Not open for further replies.

ItIsHardToProgram

Technical User
Mar 28, 2006
946
CA
Hello every one,

Maybe I am not approaching this currectly, and I believe that you will all tell me that a Userform is the best way to do this, but I still want to do it in a worksheet (yes yes I am very stubborn).

My problem is quite simple, and will take about .5 seconds to think of an answer and 2 seconds to write it down.

I have this function that is suppose to hide or not a specific image that was inserted in the worksheet. What I want to do and I seem unable to do it is to change the image, so basicaly chaning the link, for example:

Image1.path = ("C:/windows/bureau/image1.gif")

I want the same shape (same object basicaly) to become
("C:/windows/bureau/image2.gif")

so in that case the image switches, is that possible in a worksheet, or am I approaching this from the wrong angle?

Thank you very much for your help, it is always appreciated.

"Knowing that you know is the greatest sign of stupidity, knowing that you are ignorant is the best proof of intelligence.
 



Hi,

Are you codeing this in VB or in Excel workbook VBA?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Excel workbook VBA, sorry for not mentioning.

Thanks Skip, always a pleasure

"Knowing that you know is the greatest sign of stupidity, knowing that you are ignorant is the best proof of intelligence.
 



Please post VBA questions in Forum707.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 



duh! Where is my head???

Sorry!

Be back in a while.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
LOL -- I was scratching my head

"Knowing that you know is the greatest sign of stupidity, knowing that you are ignorant is the best proof of intelligence.
 



Macro record ADDing a picture to your sheet.

Assuming that you have ONE picture, delete that picture and then insert a new one with the new name, using your recorded code.
Code:
activesheet.pictures(1).delete
deletes the first picture on the sheet.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Alright, I was afraid I would have to go through this,

Thanks Skip for your time.

"Knowing that you know is the greatest sign of stupidity, knowing that you are ignorant is the best proof of intelligence.
 
Well it might become quite "heavy" with alot of image delete and insert, I thought a simple "refresh" with a different path might work.

I guess its not much a problem though, you are right.

"Knowing that you know is the greatest sign of stupidity, knowing that you are ignorant is the best proof of intelligence.
 



I discovered that I could LINK a bmp, for instance and change the link to display a different pic, but the gif link, created a PACKAGE that did not display the pic. I could not LINK a gif AND display the pic.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
ok so, the format of the picture does not really mather as it is not animated or anything, and it does not need to be of a specific dimension and quality. How did you LINK the bmp and change it to display a different pic?

I believe this will also work with jpeg.

Thanks skip,

"Knowing that you know is the greatest sign of stupidity, knowing that you are ignorant is the best proof of intelligence.
 



"How did you LINK the bmp and change it to display a different pic?"

I did an Insert > Object - LINKED

It did not work for a jpg, but does for a bmp. You can edit the link in the formula bar to change the filename.

Macro record to get the code.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Alright thanks a bunch!

Enjoy your evening!

"Knowing that you know is the greatest sign of stupidity, knowing that you are ignorant is the best proof of intelligence.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top