Hello experts,

I have an application that copies ranges/charts from Excel as images and pastes them into PowerPoint. I then run the image thru a subroutine to set the location within the slide. My problem is that this works just fine in PowerPoint 2010 but doesn't work in PowerPoint 2013. I don't get any error messages, but it bombs out of the sub immediately after pasting the image.

Here is the code of the sub in question:

Sub FormatShape(ppApp As PowerPoint.Application, ppSlide As PowerPoint.Slide, SHHeight, SHWidth, SHLeft, SHTop, LockRatio)
                 
    Dim ppShape As PowerPoint.ShapeRange

    Set ppShape = ppSlide.Shapes.Paste   'exits immediately after this!
        
    With ppShape
            
        If LockRatio = "True" Then
            .LockAspectRatio = msoTrue
        ElseIf LockRatio = "False" Then
            .LockAspectRatio = msoFalse
        End If
            
        .Height = SHHeight
        .Width = SHWidth
        .Left = SHLeft
        .Top = SHTop

    End With
    
    Set ppShape = Nothing
    
End Sub