How to Automatically Refresh Excel Charts After VBA Updates in WPS Spreadsheets
Question details
The user needs a reliable way to make Excel charts refresh automatically after a VBA macro changes their source data.

- Product
- WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- A VBA macro updates chart source data in a workbook, and the user expects all affected charts to reflect the new values without manual refresh.
- Observed behavior
- Charts do not refresh automatically after the macro runs; Chart.Refresh is inconsistent, and charts in other workbooks remain stale.
Before editing the VBA code or chart source, save the workbook as a macro-enabled file and confirm that every chart series points to a clear source range, Excel Table, or defined name. If possible, open only the affected workbook to avoid cross-workbook chart cache issues.
Use an Excel Table or defined name as the chart source
Choose this when you want the most predictable chart refresh behavior from VBA updates, because chart series linked to a table or defined name can update when the underlying range changes.
Excel charts cache the source data at creation time. A plain range reference may not tell the chart to repaint after VBA changes values; an Excel Table or defined name gives a stable, identifiable source that is easier to refresh and debug.
Select the chart's source data range in WPS Spreadsheets, go to the Insert tab, and choose Table. Confirm the range and enable My table has headers if it applies.
Right-click the chart and choose Select Data. Update each series values range to use the new table range or the table name.
Open the macro in the VBA editor with Alt+F11 and change the source data assignment so it updates the Excel Table range or the named range that the chart uses.
In the macro, add a line or method to refresh the chart object after updating the source, such as calling the chart object's Refresh method, then run the macro to test.

Refresh PivotTables, queries, and charts explicitly after the macro
Use this when the workbook contains PivotTables, Power Query connections, or charts on multiple sheets and the macro updates several source areas.
Use Power Query with an Excel Table or PivotTable for a more reliable refresh workflow
Use this when the source data is imported or transformed regularly, and you want a repeatable refresh process instead of manually updating many chart series.
Use WPS Spreadsheets to Build a Table-Based Chart That Refreshes After VBA Updates
In WPS Spreadsheets, you can link charts to Excel Tables or defined names, update the source with a macro, and refresh the chart from the Data tab or VBA. This gives you a stable macro-driven refresh workflow for Excel-compatible workbooks.
- 1. Open the macro-enabled workbook in WPS Spreadsheets: Launch WPS Office, open the .xlsm or .xlsx workbook that contains the VBA macro and charts, and enable macros if prompted.
- 2. Convert chart source data to an Excel Table: Select the source range, go to Insert > Table, confirm the range, and then point each chart series to that table via Select Data.
- 3. Update the VBA macro data source: Open the VBA editor with Alt+F11, edit the macro so it writes new values into the table or defined name that the chart uses.
- 4. Refresh the chart and dependent objects: After the macro runs, go to Data > Refresh All or use the chart refresh command, and confirm every affected chart now shows the new data.

Frequently Asked Questions
Why don't Excel charts refresh automatically after a VBA macro changes their source data?
Charts keep a cached view of their source range, and Excel has no universal command that repaints every chart automatically. The source range, table, query, or PivotTable must be updated first, and then each dependent chart must be refreshed explicitly.
How do I make a chart update automatically when the source range changes?
Use an Excel Table or a defined name as the chart source. When VBA updates the table or named range, use the chart refresh command or Data > Refresh All so the chart reads the current values.
Does WPS Spreadsheets support VBA macros that update Excel charts?
WPS Spreadsheets can open macro-enabled Excel workbooks and provides a familiar VBA editor in supported environments. For the most reliable refresh, keep the chart source as an Excel Table or defined name and refresh each affected chart after the macro runs.
Can Power Query make chart refresh more reliable?
Yes. Load Power Query output into an Excel Table or PivotTable, build the chart from that output, and use Data > Refresh All to refresh the query and connected table before the chart updates.
What should I do when charts in other workbooks are also affected?
Open each affected workbook and refresh its dependent objects, or update the VBA macro so it explicitly opens and refreshes those workbooks. Also check that the macro is not leaving chart links pointing to stale caches.




