SYNOPSIS-
I need to copy an image (.png format) embedded in one Excel picture object into another existing picture (overwriting its image data), while leaving intact the target shape's identity and fields (position, visibility, size, title, etc). This is with simple pictures, not ActiveX OLEObjects.
SITUATION:
I'm on Windows 7, Excel 2010.
I've got a sheet with multiple picture objects in the UI.
Depending on a user's setting, the displayed pictures need to change frequently. I've got the triggering and so forth all set up.
Sometimes, a single shape will need to display one of several different pictures. I'd like to just copy in the picture data from the "library" picture (embedded in another shape, hidden from the user) to that destination, but I can work around this by simply swapping in and out the picture objects.
However, sometimes multiple shapes in the UI will need to display the same image, even while retaining their unique data (name, id, size, visibility, title, etc). The "swap" trick on that is prohibitive - I'd have to create fifty copies of every single "library" object, one for each instance in the UI that might need to take on that appearance.
DESIDERATUM:
So what I'd like to do is to simply have one library copy of those pictures, and be able to copy that image into the picture objects that are integrated into the UI.
PROBLEM:
I can't find how to do this.
I can't find any field within the VBA data structures which corresponds to the "image" part of a picture object.
CopyPicture() and then Paste() appears to work only when the destination for Paste() is an address (e.g Range("A1")), and then it creates a new picture object. But I don't want a new object, and I don't want to paste into a cell. I want to overwrite the image data of an existing picture object with the image data of another pictur