Dear All,
I am using the following VBA code to embed PDF (non-linked) into an Excel file
ActiveSheet.OLEObjects.Add(Filename:=FilePath, Link:=False, DisplayAsIcon:=True, IconFileName:="C:\Windows\system32\packager.dll", IconIndex:=0, IconLabel:=IconName).Select
In our office everybody is using O365 so the EXCEL version we are using is the same (I checked). BUT still there are 3 different outcomes for the above mentioned VBA code:
a) Embedded file appears and the appearing name of the icon is the string defined as IconName
b) Embedded file appears, but there is no icon, a differen Logo appears and the appearing name of the embedded file is a temporary name given by the system like 6DC40FF5.pdf
c) Run-time error 1004 massage appears and the macro stops
How is it possible that the same VBA coded (using the same Excel versions) results in 3 different outcomes?
Any idea for solution?
Thanks a lot
Peter