When using Excel VBA to paste charts into PowerPoint, have you ever wanted to paste them as a static “picture (image)” rather than an editable chart?
In this article, I will explain how to paste an Excel chart as a “Shape (PNG Image)” onto a PowerPoint slide using VBA, along with the actual code.
The Goal
- Copy an Excel chart and paste it into PowerPoint in image format.
- Paste as a non-editable image, rather than using the standard
.Pastemethod (which inserts an editable object).
Method: Paste as an Image Using .PasteSpecial
By using the Shapes.PasteSpecial method in PowerPoint, you can paste copied objects in specific formats (Picture, Text, etc.).
Specifying DataType:=2 allows you to paste the content as a PNG image (Enhanced Metafile).
Standard Paste Code (Before)
Set ppSlide = ppPres.Slides(1)
Set myShape = ppSlide.Shapes.Paste
If you use the code above, the chart is pasted as an editable “Embedded Object.”
Image Paste Code (After)
By using .PasteSpecial as shown below, the chart is pasted in image format.
' Paste as a picture on the first slide
Set ppSlide = ppPres.Slides(1)
Set myShape = ppSlide.Shapes.PasteSpecial(DataType:=2) ' 2 = Image format (PNG)
About DataType Values
| Value | Constant | Description |
| 1 | ppPasteDefault | Standard paste (Editable) |
| 2 | ppPasteEnhancedMetafile | Paste as Metafile (Picture) |
| 3 | ppPasteBitmap | Paste as Bitmap image |
| 4 | ppPasteGIF | Paste as GIF image |
Generally, DataType:=2 (Enhanced Metafile) is recommended because it offers high quality and is easy to handle.
Full Code Example
Here is the complete code to copy a chart from Excel and paste it into PowerPoint as an image.
Sub PasteExcelChartAsImage()
Dim ppApp As Object
Dim ppPres As Object
Dim ppSlide As Object
Dim myShape As Object
' Launch PowerPoint
Set ppApp = CreateObject("PowerPoint.Application")
ppApp.Visible = True
' Create a new presentation
Set ppPres = ppApp.Presentations.Add
' Copy Excel chart (Assuming the first chart on the active sheet is the target)
ActiveSheet.ChartObjects(1).Chart.Copy
' Paste as a picture on the first slide
Set ppSlide = ppPres.Slides(1)
Set myShape = ppSlide.Shapes.PasteSpecial(DataType:=2)
' Adjust position (Optional)
myShape.Left = 100
myShape.Top = 50
End Sub
Summary
The most reliable way to paste Excel charts as “pictures” in PowerPoint is to use the .PasteSpecial method.
- Specify
DataType:=2to insert the chart as a non-editable image. - This avoids layout shifts and accidental editing risks compared to
.Paste. - It improves the stability of your presentation materials.
