I\'m trying to get a series of Excel tables into PowerPoint and successfully created a macro for this in Office 2013, but am trying to adapt it to Office 2010.
The i
This should do it:
Just make sure you are loading the PowerPoint Library in Excel.
Tools->References->"Microsoft PowerPoint nn.n Object Library"
Also I assume that Table3
, ChartStart
, ChartEnd
& Row2
have set values
Dim pptApp As PowerPoint.Application
Dim pptPres As PowerPoint.Presentation
Dim pptSlide As PowerPoint.Slide
'Open PowerPoint and create a new presentation.
Set pptApp = New PowerPoint.Application
Set pptPres = pptApp.Presentations.Add
Set pptSlide = pptPres.Slides.Add(1, ppLayoutBlank)
For i = 0 To Table3
Set objRange = Worksheets("Charts").Range(ChartStart, ChartEnd).Offset(i * Row2, 0)
objRange.Copy
pptSlide.Shapes.PasteSpecial DataType:=ppPasteHTML, Link:=msoFalse
Next i
For j = 1 To pptSlide.Shapes.Count
With pptSlide.Shapes(j)
.Name = "Table" & j
End With
Next j
Set pptSlide = Nothing
Set pptPres = Nothing
Set pptApp = Nothing