Code to paste shapes from Excel to ppt not working with Office 2013

camagpie

New Member
Joined
Sep 16, 2014
Messages
1
Hello,

I wrote code to copy ranges/charts/textboxes from Excel to Powerpoint in Office 2010. It worked great with no issues. Now it fails in Office 2013. Specifically:

1. If the Shape is pasted, then it is not manipulated to move where I need it to be
2. Some shapes are not pasted at all. It's as if lines of code are omitted at runtime.

I am pasting my code below. This macro is being called from another in a loop.

Sub PasteShape(wksName As String, ShapeType As String, ShapeName As String, _
pptslide As PowerPoint.Slide, IncrL As Integer, IncrR As Integer, IncrT As Integer, IncrB As Integer)
Dim myshaperange As PowerPoint.ShapeRange


'Different syntax for pasting range and textbox/chart
If ShapeType = "Range" Then
ThisWorkbook.Sheets(wksName).Range(ShapeName).Copy
Set myshaperange = pptslide.Shapes.PasteSpecial(DataType:=ppPasteBitmap)
myshaperange.Left = IncrL
myshaperange.Top = IncrT
ElseIf ShapeType = "Chart" Then
ThisWorkbook.Sheets(wksName).Shapes(ShapeName).Copy
Set myshaperange = pptslide.Shapes.PasteSpecial(DataType:=ppPasteBitmap)
myshaperange.Left = IncrL
myshaperange.Top = IncrT
Else
ThisWorkbook.Sheets(wksName).Shapes(ShapeName).Copy
Set myshaperange = pptslide.Shapes.Paste
myshaperange.Left = IncrL
myshaperange.Top = IncrT
End If


End Sub

All help will be deeply appreciated.
Thanks!
camagpie
 

Some videos you may like

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Watch MrExcel Video

Forum statistics

Threads
1,108,924
Messages
5,525,656
Members
409,658
Latest member
Yardcell

This Week's Hot Topics

Top