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
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,222,900
Messages
6,168,926
Members
452,227
Latest member
sam1121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top