Hi, I have a 70+ slide PPT presentation with embed charts from Excel that all need to be converted to pictures (so that data wouldn`t be accessible).
I have tried to compile a script that would loop through all slides, find all shapes, copy, delete and then paste them back. After that I`ll try to find a way for it to check if shapes are actually charts.
This is my first time trying to create a macro (I have no experience with VBA) so I guess there might be some silly mistakes.
So far I have got this:
[VBA]Sub ConvertCharts()
Dim SlideToCheck As Slide
Dim ShapeIndex As Integer
' Visit each slide
For Each SlideToCheck In ActivePresentation.Slides
' On each slide, count down through the shapes
For ShapeIndex = SlideToCheck.Shapes.Count To 1 Step -1
' Copy, delete, Paste
SlideToCheck.Shapes(ShapeIndex).Copy
SlideToCheck.Shapes(ShapeIndex).Delete
Application.ActiveWindow.View.PasteSpecial DataType:=ppPasteEnhancedMetafile
Next
Next
End Sub[/VBA]
With this it shows an error at line "SlideToCheck.Shapes(ShapeIndex).Copy" , Shapes (unknown member) : Integer out of range. 0 is not the valid range of 1 to 0.
I`d be glad if someone could at least point me in the right direction.