Sub Paste_Linked_Charts()
' Go to tools > References > (check) Microsoft Powerpoint # object library
Dim ppApp As PowerPoint.Application
Dim ppSlide As PowerPoint.Slide
Dim sShName As String
Dim wks As Worksheet
Dim chChart As ChartObject
Dim lchNum As Long
Dim bSlidesToEnd As Boolean
sShName = ActiveSheet.Name
lchNum = 1
bSlidesToEnd = True
On Error Resume Next
Set wks = Sheets(sShName)
Set chChart = Sheets(sShName).ChartObjects(lchNum)
On Error GoTo 0
' Look for existing instance
On Error Resume Next
Set ppApp = GetObject(, "PowerPoint.Application")
On Error GoTo 0
' Create new instance if no instance exists
If ppApp Is Nothing Then Set ppApp = New PowerPoint.Application
' Add a presentation if none exists
If ppApp.Presentations.Count = 0 Then ppApp.Presentations.Add
' Make the instance visible
ppApp.Visible = True
' Check that a slide exits, if it doesn't add 1 slide. Else use the last slide for the paste operation
If ppApp.ActivePresentation.Slides.Count = 0 Then
Set ppSlide = ppApp.ActivePresentation.Slides.Add(1, ppLayoutBlank)
Else
If bSlidesToEnd Then
' Appends slides to end of presentation and makes last slide active
ppApp.ActivePresentation.Slides.Add ppApp.ActivePresentation.Slides.Count + 1, ppLayoutBlank
ppApp.ActiveWindow.View.GotoSlide ppApp.ActivePresentation.Slides.Count
Set ppSlide = ppApp.ActivePresentation.Slides(ppApp.ActivePresentation.Slides.Count)
Else
' Sets current slide to active slide
Set ppSlide = ppApp.ActiveWindow.View.Slide
End If
End If
Worksheets(sShName).Activate
ActiveSheet.ChartObjects(lchNum).Select
ActiveChart.ChartArea.Copy
ppSlide.Shapes.PasteSpecial(link:=True).Select
ppApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
ppApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
AppActivate ("Microsoft PowerPoint")
Set ppSlide = Nothing
Set ppApp = Nothing
End Sub