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
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