PDA

View Full Version : Embedded Object "Management"



MWE
11-22-2005, 09:59 AM
further to my earlier thread (http://www.vbaexpress.com/forum/showthread.php?p=50784#post50784) about displaying embedded objects via VBA ...

Thanks to Jon's help :thumb, I was able to develop a pretty useful embedded object display procedure. Given the possibility of multiple objects on a sheet, the procedure uses the object's name to find the right object. Changing the object's name is pretty simple, and useful names are certainly preferred over things like "Object 5". Changing the "path\name" displayed as part of the object icon is more difficult. It is mostly cosmetic, but I would like to clean up this approach. Anyone know how to change that?

NOTE: when an object is initially inserted and the "display as icon" method is selected, you can change the icon caption or label via the "Change Icon" button. This accomplishes what I want to do. But assuming that you already have the object inserted, how do you change the icon's caption or label?

Also, I have looked through the OLEobject properties list and can not find anything related to the original or native application. For, say, a Word document embedded in Excel, OLEObject.Parent.Name is the owning worksheet and OLEObject.Application is Excel. Original appl info must be there else how would Excel know what appl to spawn to open the object. Any help would be appreciated.

Killian
11-23-2005, 12:16 PM
I'm not sure if the IconLabel property is exposed to the object model outside the Add method... I'll have a dig around.
Regarding the Object's application type, this is stored in it\s ProgID propertyDim objOLE As OLEObject

For Each objOLE In ActiveSheet.OLEObjects
Debug.Print objOLE.progID
Next