John Carney
asked on
Copying a chart in Excel and pasting it in a specific place in a Powerpoint slide ?
I have a simple code that copies the chart and places it in the middle of the Powerpoint slide
Thanks,
John
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide
ThisWorkbook.Sheets(1).ChartObjects("Chart 3").CopyPicture
With PPPres.Slides(2).Shapes.Paste
.Align msoAlignCenters, True
.Align msoAlignMiddles, True
End With
My primary question is how do I specify the exact position at which to paste the chart? I came across some code that will do the positioning but I can't figure out how to adapt it:Set oSlide = ActivePresentation.Slides(lCurrSlide)
Set oShape = oSlide.Shapes.Paste
oShape.top = 10
oShape.Left = 10
oShape.Width = 282
oShape.Height = 192
Eventually I would also like to open the presentation based on these parameters but first I want to get the positioning done.Thanks,
John
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Good work, John. If I do say so myself! :- )
ASKER
Open in new window