Hi All,
I am using the below code to paste charts to PPT to specific slides.
For each chart, I would like to be able to:
- set the chart size as I wish
- add a ppt text box below my chart where I can add comments.
Someone can help me? Cheers
I am using the below code to paste charts to PPT to specific slides.
For each chart, I would like to be able to:
- set the chart size as I wish
- add a ppt text box below my chart where I can add comments.
Someone can help me? Cheers
HTML:
Sub copierppt()Dim PPT As PowerPoint.ApplicationDim PptDoc As PowerPoint.PresentationDim NbShpe As ByteDim i As Integer
Set PPT = CreateObject("Powerpoint.Application")PPT.Visible = True 'l'application sera visible
Set PptDoc = PPT.Presentations.Open("H:\Marketing Strategy\Attrition Report\Attrition Q1+Q2\Attrition\Attrition.pptx")
'3 ################### slide 3 #################### PPT.ActiveWindow.View.GotoSlide Index:=3
ThisWorkbook.Worksheets("OVERVIEW_SUMMARISE").ChartObjects("C_OS_1").Copy
PPT.ActiveWindow.Panes(1).Activate
PPT.CommandBars.ExecuteMso ("PasteSourceFormatting") NbShpe = PptDoc.Slides(3).Shapes.Count
With PptDoc.Slides(3).Shapes(NbShpe) .Left = 50 .Top = 230 .Height = 300 .Width = 700 End With DoEvents '4 ################### slide 4 #################### PPT.ActiveWindow.View.GotoSlide Index:=4
ThisWorkbook.Worksheets("OVERVIEW_SUMMARISE").ChartObjects("C_OS_2").Copy
PPT.ActiveWindow.Panes(1).Activate
PPT.CommandBars.ExecuteMso ("PasteSourceFormatting") NbShpe = PptDoc.Slides(4).Shapes.Count
With PptDoc.Slides(4).Shapes(NbShpe) .Left = 50 .Top = 230 .Height = 300 .Width = 700 End With 'Clean up Set PPSlide = Nothing Set PPPres = Nothing Set PPApp = Nothing End Sub