vba - How to copy multiple charts from Excel and embed it to PPT? -
i know question has been posted few times, still having issues.
i relatively new vba, please bare me!
i trying copy , paste multiple charts sheet in excel slide in powerpoint. have:
public sub createmanagmentpres() dim ppapp powerpoint.application dim pppres powerpoint.presentation dim ppslide powerpoint.slide dim pptextbox powerpoint.shape set ppapp = new powerpoint.application ppapp.visible = true ppapp.activate set pppres = ppapp.presentations.add 'summary of assumptions (cont'd) set ppslide = pppres.slides.add(6, pplayouttitleonly) ppslide.select ppslide.shapes(1).textframe.textrange.text = "summary of assumptions (cont'd)" activeworkbook.sheets("case summary").chartobjects("chart rev").copy pppres.slides(6).shapes.pastespecial(datatype:=pppasteoleobject, _ link:=msotrue) end ppslide.shapes(2).top = 70 ppslide.shapes(2).left = 11 activeworkbook.sheets("case summary").chartobjects("chart lev").copy pppres.slides(6).shapes.pastespecial(datatype:=pppasteoleobject, _ link:=msotrue) end ppslide.shapes(3).top = 70 ppslide.shapes(3).left = 370
this returns "shapes (unknown member).invalid request. specified data type unavailable. related with pppres.slides(6).shapes.pastespecial(datatype:=pppasteoleobject, _ link:=msotrue)
i saw post related changed code to:
set ppslide = pppres.slides.add(6, pplayouttitleonly) ppslide.select ppslide.shapes(1).textframe.textrange.text = "summary of assumptions (cont'd)" activeworkbook.sheets("case summary").chartobjects("chart rev").chartarea.copy pppres.slides(6).shapes.pastespecial(datatype:=pppasteoleobject, link:=msotrue) '~~> rest of code here end ppslide.shapes(2).top = 70 ppslide.shapes(2).left = 11
now "object doesn't support property or method" on:
activeworkbook.sheets("case summary").chartobjects("chart rev").chartarea.copy
please if can! , thank in advance!
Comments
Post a Comment