I have two issues in this code. This code works fine sometimes but attimes gives the following error: Run Time Error - 2147188160 (80048240) Shapes (unknown member): Invalid Request. Clipboard is empty or contains data which may not be pasted here. It is coming on the below mentioned code When I am trying to paste the range/table.

pres.Slides(2).Shapes.Paste
Second Question: now the chart is getting copied in the powerpoint second thing which I want to know if I need to position it. In case there was no specific slide (slide 2) where I would like to put the chart at top left corner then t how shud I modify the below code: – preslide.Shapes.PasteSpecial (ppPasteHTML)

With preslide.Shapes(preslide.Shapes.Count)

.Top = 65 .Left = 72 .Width = 700

Sub latestppu()
Dim pptapp As PowerPoint.Application
Dim pres As PowerPoint.Presentation
Dim preslide As PowerPoint.Slide
Dim shapepp As PowerPoint.Shape
Dim exappli As Excel.Application
Dim exworkb As Workbook
Dim rng As Range
Dim myshape As Object
Dim x As Integer
x = 1
Dim mychart As ChartObject
Dim activechart As ChartObject
Dim R As Integer
Dim G As Integer
Dim B As Integer

'Open powerpoint application -
Set exappli = New Excel.Application
exappli.Visible = True

'activate powerpoint application
Set pptapp = New PowerPoint.Application
pptapp.Visible = True
pptapp.Activate

'open the excel you wish to use
Set exworkb = exappli.Workbooks.Open("C:\Users\as\Desktop\Macro\Reference Sheet.xlsm")

'open the presentation you wish to use
Set pres = pptapp.Presentations.Open("C:\Users\as\Desktop\Macro\PPTtemplate.pptx")
'Add title to the first slide
With pres.Slides(1)
If Not .Shapes.HasTitle Then
Set shapepp = .Shapes.AddTitle
Else: Set shapepp = .Shapes.Title
End If
With shapepp
.TextFrame.TextRange.Text = "Gulf+ Mark" & vbNewLine & "P5 Week FY17"
.TextFrame.TextRange.Font.Name = "Arial Black"
.TextFrame.TextRange.Font.Size = 24
.TextEffect.FontBold = msoTrue
.TextFrame.TextRange.Paragraphs.ParagraphFormat.Alignment = ppAlignLeft
End With
End With
'Add title to second slide
With pres.Slides(2)
If Not .Shapes.HasTitle Then
Set shapepp = .Shapes.AddTitle
Else: Set shapepp = .Shapes.Title
End If
With shapepp
.TextFrame.TextRange.Text = "Gulf+ Performance"
.TextFrame.TextRange.Font.Name = "EY Gothic Cond Demi"
.TextFrame.TextRange.Font.Size = 22
.TextFrame.TextRange.Paragraphs.ParagraphFormat.Alignment = ppAlignLeft
.TextEffect.FontBold = msoFalse
.TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 0)
.TextEffect.Alignment = msoTextEffectAlignmentLeft
End With
End With
'add a textbox
Set shapepp = pres.Slides(2).Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=650, Top:=75, Width:=200, Height:=50)
With shapepp
.TextFrame.TextRange.Text = "Other Account Performance Metrics"
.TextFrame.TextRange.Font.Name = "EY Gothic Cond Demi"
.TextFrame.TextRange.Font.Size = 16
.TextFrame.TextRange.Paragraphs.ParagraphFormat.Alignment = ppAlignRight
.TextEffect.FontBold = msoTrue
.TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 0)
End With

'Copy a table range from account summary worksheet and paste it in powerpoint slide 2:-
'defining the range
Set rng = exworkb.Sheets("Account Performance").Range("A1:B5")
'Copy excel range
rng.Copy
'paste to powerpoint slide 2
pres.Slides(2).Shapes.Paste
pptapp.ActiveWindow.Selection.ShapeRange.Align msoAlignTops, msoTrue
pptapp.ActiveWindow.Selection.ShapeRange.Top = -30
pptapp.ActiveWindow.Selection.ShapeRange.Left = 350


'add a textbox
Set shapepp = pres.Slides(2).Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=600, Top:=280, Width:=200, Height:=50)
With shapepp
.TextFrame.TextRange.Text = "GTER by global account segment"
.TextFrame.TextRange.Font.Name = "EY Gothic Cond Demi"
.TextFrame.TextRange.Font.Size = 16
.TextFrame.TextRange.Paragraphs.ParagraphFormat.Alignment = ppAlignRight
.TextEffect.FontBold = msoTrue
.TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 0)
End With
'defining the second chart to be copied
Set mychart = exworkb.Sheets("Account Performance").ChartObjects(1)
mychart.Select
mychart.Chart.ChartArea.Copy
pres.Slides(2).Shapes.Paste
pptapp.ActiveWindow.Selection.ShapeRange.Align msoAlignTops, msoTrue
pptapp.ActiveWindow.Selection.ShapeRange.Top = 2000
pptapp.ActiveWindow.Selection.ShapeRange.Left = 350

End Sub