logo
search
VBA & Macro Problems

How to Export Excel Charts and Ranges to PowerPoint using VBA

Maira MehtabMaira Mehtab Sep 22, 2026 869 views

Question details

The user needs to export charts and specific cell ranges from an Excel worksheet into a PowerPoint presentation or save them as image files using a VBA macro.

Product
Excel / PowerPoint
Device & OS
not provided
Scenario
Automating the transfer of data visualizations and selected data ranges from an Excel workbook to a PowerPoint slide deck for presentations.
Observed behavior
Users want to successfully copy and paste objects without encountering 'Permission Denied', 'Error 70', blank charts, or format loss.
Before you start

Before running any macros, ensure that you have enabled Developer options in Excel and that your macro security settings allow VBA scripts to execute safely.

Solution 1Recommended

Export Charts and Ranges to PowerPoint via VBA Automation

Use a VBA macro with PowerPoint automation to loop through charts and specific ranges, pasting them directly into newly created slides.

This method uses PowerPoint automation to create a new presentation instance in the background. The macro loops through all charts on the active Excel worksheet and pastes each one onto a new slide. It then copies a defined cell range (e.g., A1:C10) and pastes it into an additional slide using the PasteSpecial method.

1
Open the VBA Editor

Press ALT + F11 in Excel to open the Visual Basic for Applications (VBA) Editor.

2
Insert a New Module

Click on 'Insert' in the top menu and select 'Module' to create a blank script window.

3
Initialize PowerPoint Automation

Declare your variables and use CreateObject("PowerPoint.Application") to launch a new PowerPoint presentation instance within your script.

4
Loop and Paste Charts

Write a For Each loop targeting ActiveSheet.ChartObjects. Copy each chart, add a new slide to the PowerPoint presentation, and use the PasteSpecial method to insert the chart.

5
Copy and Paste the Range

Define your specific data area, such as Range("A1:C10").Copy, insert one final slide in the presentation, and paste the range.

6
Run and Save

Include code to save the new PowerPoint file to the workbook's folder (ActiveWorkbook.Path). Press F5 to execute the macro.

Reference Object Library: If you are using early binding instead of late binding, make sure to enable the 'Microsoft PowerPoint Object Library' under Tools > References in the VBA Editor.

Export Charts and Data Ranges Easily in WPS Office

WPS Office provides seamless integration between Spreadsheets and Presentation, allowing you to easily transfer charts, tables, and data ranges without writing complex VBA code.

  1. 1. Select the Chart or Data: Open your workbook in WPS Spreadsheets. Click on the chart or highlight the data range (e.g., A1:C10) you want to export.
  2. 2. Copy the Content: Right-click the selection and click 'Copy', or simply press Ctrl + C on your keyboard.
  3. 3. Paste into WPS Presentation: Switch to the WPS Presentation tab, create a new slide, right-click, and select 'Keep Source Formatting' or 'Paste as Picture'.
  4. 4. Export as Picture Directly: Alternatively, right-click any chart or highlighted range in WPS Spreadsheets and select 'Save as Picture' to quickly export it as an image file without needing PowerPoint.
Fully compatible with Microsoft Excel (.xlsx) formats and chartsSeamless copy-pasting of charts and ranges with formatting fully preservedBuilt-in 'Save as Picture' tool for instantly exporting charts and ranges as imagesLightweight suite integrating Spreadsheets and Presentation in one tabbed window
QA img-9

Frequently Asked Questions

Why am I getting a 'Permission Denied' (Error 70) in VBA?

Error 70 usually occurs if the file you are trying to overwrite is currently open in another program, or if your VBA script lacks the necessary folder permissions to save the PowerPoint or image file in the specified directory.

Why do my exported Excel charts appear blank in PowerPoint?

Blank charts can happen if the macro copies the chart before Excel has fully rendered it. Adding a DoEvents or Application.Wait command just before the copy action can give Excel enough time to render the chart properly.

Can I export an Excel range as an image instead of a PowerPoint slide?

Yes, you can use VBA to copy the range as a picture using Range.CopyPicture, paste it into an empty temporary ChartObject, and then use the Chart.Export method to save it locally as a JPEG or PNG file.