Copy Charts from Excel to PowerPoint Automatically

How to copy Excel charts to PowerPoint automatically using VBA.

Watch the video below:

Automatically Copy Charts from Excel to PowerPoint

When creating PowerPoint presentations and making them more useful, we may need many charts from Excel. We can bring these charts from our Excel workbooks to PowerPoint presentation quickly and easily using Visual Basic for Applications (VBA).

Below is the complete VBA code to automate the process of getting charts from Excel into our PowerPoint slides:

Option Explicit

Sub copyexcelchartstopowerpoint()
‘we first set reference to the MS PowerPoint Object Library

Dim PP As PowerPoint.Application
Dim PPPresentation As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim ppSlideCount As Long, SlideCount As Long
Dim i As Long

Sheets(“SalesOrders”).Select
If ActiveSheet.ChartObjects.Count < 1 Then
MsgBox “No charts found!”
Exit Sub
End If

Set PP = New PowerPoint.Application
Set PPPresentation = PP.Presentations.Add
PP.Visible = msoTrue

For i = 1 To ActiveSheet.ChartObjects.Count
ActiveSheet.ChartObjects(i).Chart.CopyPicture Size:=xlScreen, Format:=xlPicture
Application.Wait (Now + TimeValue(“00:00:01”))
ppSlideCount = PPPresentation.Slides.Count
Set PPSlide = PPPresentation.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPSlide.Select
PPSlide.Shapes.Paste.Select
PP.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, msoCTrue

Next i

‘cleanup memory
Set PPSlide = Nothing
Set PPPresentation = Nothing
Set PP = Nothing

End Sub

Copy Excel Charts to PowerPoint Automatically Using VBA
Copy Excel Charts to PowerPoint Automatically Using VBA

Further Reading

Copy Chart from Excel to PowerPoint Using VBA

Published by

Dinesh Kumar Takyar

Welcome to exceltrainingvideos.com! My aim is to help you learn MS Excel including VBA. I always felt that a good way to learn something was to find solutions to problems in that domain. That is why I share these Excel videos with you. Mostly these are questions asked during my corporate training sessions. I've been training individuals and companies in computers since 1991. I did my B. Sc. (Vordiplom), M. Sc. (Diplom) and Ph.D. (Dr. rer. nat.) from Hamburg, Germany. The best thing about solving some of my visitor's questions is that I also gain new insights. For more Excel VBA solutions you may like to visit my YouTube channel: http://youtube.com/familycomputerclub For a structured Excel VBA training course online you can visit: https://www.youtube.com/excelvbaonline

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.