0
votes

I need to copy excel data to powerpoint slides but shape get truncated after paste special.

This is my code:

    Set myShape = mySlide.Shapes("obj" & i)
    mySlide.Shapes.PasteSpecial DataType:=2
    Set newShape = mySlide.Shapes(mySlide.Shapes.Count)
    newShape.LockAspectRatio = msoFalse
    newShape.Left = myShape.Left
    newShape.Top = myShape.Top
    newShape.Height = myShape.Height
    newShape.Width = myShape.Width

    myShape.Delete

I need to replace existing shapes same as their properties so I first get the shape and set its properties to new shape and then delete it.

Before I run the code the shape is this: Before

After shape is this(truncated): After I tried other data types also but in vain.

1
What is your source shape? Is it a group of rectangles or a table? Are you pasting into a selection e.g. a placeholder? Could you share the file?Jamie Garroch - MVP
Further to Jamie's question, are you pasting onto a slide with any blank content or picture placeholders?Steve Rindsberg
Thanks for your comments. The problem was that the range array was changed when i run the code. So, after fixing it, than shape no more truncates.PalFS

1 Answers

0
votes

I fixed the problem my self when i debug the code. The problem was that the range array gets changed when i run the code. So, after fixing it, than shape no more truncates.