BrI
05-06-2017, 08:46 AM
I'm using VBA to embed documents into a worksheet as follows:
ActiveSheet.OLEObjects.Add _
Filename:="C:\Users\T400\Desktop\TEST.pdf", _
Link:=False, _
DisplayAsIcon:=True, _
IconFileName:="C:\Users\T400\Documents\My Custom Icon.ico", _
IconIndex:=0, _
IconLabel:="My Custom Label"
This does embed an object with a custom icon and label as I want, but when the file is saved both the Icon and label revert to the defaults (in this case the Adobe symbol and file name).
This may be a known unresolved issue as I found a case here: stackoverflow.com/questions/33094951/ole-object-attachment-on-excel-worksheet-icon-label-displaying-as-random-alpha
However, wondering if there is a solution, especially as excel has a manual method to embed custom icons via the ribbon (See: datapigtechnologies.com/blog/index.php/changing-the-look-of-embedded-objects/ )
Even when I use the manual process, the icon and label revert to the defaults when saved.
Any ideas on how to resolve?
ActiveSheet.OLEObjects.Add _
Filename:="C:\Users\T400\Desktop\TEST.pdf", _
Link:=False, _
DisplayAsIcon:=True, _
IconFileName:="C:\Users\T400\Documents\My Custom Icon.ico", _
IconIndex:=0, _
IconLabel:="My Custom Label"
This does embed an object with a custom icon and label as I want, but when the file is saved both the Icon and label revert to the defaults (in this case the Adobe symbol and file name).
This may be a known unresolved issue as I found a case here: stackoverflow.com/questions/33094951/ole-object-attachment-on-excel-worksheet-icon-label-displaying-as-random-alpha
However, wondering if there is a solution, especially as excel has a manual method to embed custom icons via the ribbon (See: datapigtechnologies.com/blog/index.php/changing-the-look-of-embedded-objects/ )
Even when I use the manual process, the icon and label revert to the defaults when saved.
Any ideas on how to resolve?