How to Update a PowerPoint Chart with Excel VBA Data
Question details
The user needs to successfully update an existing PowerPoint chart using data from a separate Excel workbook via a VBA macro.

- Product
- Excel, PowerPoint
- Device & OS
- not provided
- Scenario
- Running an Excel VBA macro to automatically push data into a PowerPoint presentation chart located in another workbook.
- Observed behavior
- The VBA macro executes without errors, but the target PowerPoint chart does not update due to incorrect presentation references or failure to activate the embedded chart data.
Ensure both the source Excel workbook and the target PowerPoint presentation are accessible on your local drive, and that your macro security settings allow VBA code execution.
Correct Object References and Activate Chart Data
Fixing variable declarations and explicitly activating the chart's embedded workbook ensures the data is written correctly to the PowerPoint chart.
A common pitfall when updating PowerPoint charts from Excel is relying on ActivePresentation or failing to open the embedded data table. Explicitly declaring your objects and interacting directly with the ChartData workbook resolves these silent failures.
Add 'Option Explicit' at the very top of your VBA module. Declare your application and presentation variables properly, such as 'Dim PPApp As Object' and 'Dim pppres As Object'.
Avoid using 'ActivePresentation' multiple times, as it can inadvertently reference the wrong open file. Use 'Set pppres = PPApp.Presentations.Open("C:\Path\To\Your\File.pptx")' to explicitly assign the target presentation to your variable.
Remove any '.Select' commands applied to the chart. Instead, point directly to the specific shape containing the chart on your target slide, for example: 'Set myChart = pppres.Slides(1).Shapes("Chart 1").Chart'.
Before attempting to write the new Excel data into the PowerPoint chart, you must activate its underlying data structure by executing 'myChart.ChartData.Activate'. This exposes the embedded Excel instance so your data can be updated.

Automate Cross-App Workflows with WPS Office VBA
WPS Office includes robust, built-in VBA support, empowering you to seamlessly write macros that automate data transfers between WPS Spreadsheet and WPS Presentation with high efficiency.
- 1. Open WPS Spreadsheet: Launch WPS Spreadsheet and press ALT + F11 to open the integrated VBA editor.
- 2. Write the automation script: Insert a new module and paste your VBA code designed to interact with WPS Presentation chart objects.
- 3. Execute the macro: Click 'Run' or press F5 to execute the macro, which will push the designated spreadsheet data into your presentation chart automatically.

Frequently Asked Questions
Why does my VBA code run without errors but the PowerPoint chart doesn't update?
This typically occurs when the macro writes to a chart object without first executing the '.ChartData.Activate' method. Without this activation, the embedded data table remains closed to external data inputs, causing silent update failures.
Do I need to use the .Select method to update a chart in VBA?
No, using '.Select' is generally inefficient and prone to runtime errors. It is best practice to manipulate the chart directly using an object reference, such as 'Slides(1).Shapes("Chart Name").Chart'.
How can I prevent my macro from targeting the wrong open presentation?
Avoid setting variables to 'ActivePresentation', especially if multiple PowerPoint files are open. Use the 'Presentations.Open' method to explicitly load the target file and assign it directly to your presentation object variable.




