This is my first post on the excel forum, and I like to think I am good at excel, but this is alluding me. I am trying to automate the metrics I generate, and I've managed to get the excel raw data manipulation down and the excel charts to ppt down, but I want more automation, so I'm trying to added a few embedded files as well.

fpath = "folders\"
f1 = "docname1.pdf"
f2 = "docname2.xlsx"
f3 = "docname3.xlsx
f4 = "docname4.docx"
dtvr= cyear & cmonth & cday
set mypres = ppt_app.presentations("string" & dtvr & ".pptx"
n = mypress.slides.count -1
set myslides = mypress.slides(n)
myslides.shapes.addoleobject Filename:=fpath & f1, link:=msoFalse, displayasicon:=msoTrue, iconlabel:=f1, iconindex:=5, iconfiliename:="C:\Windows\Installer\{90160000-000F-0000-1000-0000000FF1CE}\xlicons.exe"
I will probably delete the current icons that are there and replace the iconindex with a 1 assuming it works with bit of code.

variant of the addoleobject
set osh = myslides.shapes.addoleobject -then parameters
I tried to follow the workbooks.worksheets logic and the examples i've found and it looks right, but i get the error: '-214767259 (80004005) Method 'AddOLEObject' of object 'Shapes' failed. Any help to fix my code or simpler method of embedding objects will be greatly appreciated.