A little ExcelXP help on copying pictures please

Associate
Joined
28 Jan 2005
Posts
976
Got a query about copying pictures between workbooks in ExcelXP using VBA code.

I have a workbook with a picture in it called "Picture 11". There is a macro that copies this picture to another workbook, then later cuts it again.
Thing is, the line of code to tell it to cut uses the command
Activesheet.Shapes("Picture 1").cut

And it works. But the picture name that is copied over was Picture 11, not Picture 1. There are no other shape objects on the sheet.

How does this work? I expected the code to break when it hit that line since "Picture 1" does not exist.

Does Excel keep the name as "Picture 11" but somehow refer to it in the new workbook as "Picture 1" because it's the first (and only) object on the sheet? Or is this some sort of bug in Excel?
 
Top Bottom