I'm trying to create a macro for use within Excel, that allows the user to attach a file as an icon (as they wont be able to use the insert object method).
I've got to the point where the macro successfully attaches the file but the icon ends up being a blank white rectangle larger than what would be produced normally.
Dim File As Variant
File = Application.GetOpenFilename
ActiveSheet.OLEObjects.Add(Filename:=File, Link:=False, DisplayAsIcon:=True).Select
The third line is based on the following recorded macro but obviously returns specific values for the icon and file name to be used.
ActiveSheet.OLEObjects.Add(
Filename:= "filepath" ,
Link:=False,
DisplayAsIcon:=True,
IconFileName:= "path for icon",
IconIndex:=0,
IconLabel:="filename").Select
Is there any way to get the IconFileName and the IconLabel from the File = Application.GetOpenFilename for use within the ActiveSheet code?
Also, is there any way to specify the size of the icon that is then displayed?
Thanks in advance.
