Hi, I am currently looking to use the following to convert linked excel tables to pictures in powerpoint which works well however it doesn't seem to delete the previous tables or position the new ones in the provious locations.
Can anyone tell me what the problem in the code is? sorry I am new to VBA!!!
Many thanks
Jamie
Sub ConvertAllShapesToPic()
Dim oSl As Slide
Dim oSh As Shape
On Error Resume Next
For Each oSl In ActivePresentation.Slides
For Each oSh In oSl.Shapes
' modify the following depending on what you want to
' convert
Select Case oSh.Type
Case msoEmbeddedOLEObject, msoLinkedOLEObject
ConvertShapeToPic oSh
Case Else
End Select
Next
Next
NormalExit:
Exit Sub
ErrorHandler:
Resume Next
End Sub
Sub ConvertShapeToPic(ByRef oSh As Shape)
Dim oNewSh As Shape
Dim oSl As Slide
Set oSl = oSh.Parent
oSh.Copy
Set oNewSh = oSl.Shapes.PasteSpecial(ppPasteEnhancedMetafile)(1)
oSh.PickupAnimation
oNewSh.ApplyAnimation
With oNewSh
.Left = oSh.Left
.Top = oSh.Top
Do
.ZOrder (msoSendBackward)
Loop Until .ZOrderPosition = .ZOrderPosition
.AnimationSettings.AnimationOrder = oSh.AnimationSettings.AnimationOrder
End With
oSh.Delete
NormalExit:
Exit Sub
ErrorHandler:
Resume Next
End Sub
Bookmarks