Fix Excel Office Scripts Not Recording Multiple PivotTable Slicer Connections
Question details
Users need a way to link a single slicer to multiple PivotTables using Office Scripts, but the macro recorder does not capture this action.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Recording an automation script in Excel for the web to connect one slicer to several PivotTables simultaneously.
- Observed behavior
- The Action Recorder in Office Scripts ignores the steps taken to connect the slicer to multiple PivotTables, leaving the resulting script incomplete.
Ensure you are using a version of Excel that supports Report Connections (such as Microsoft 365 or Excel for the web) and verify that all your PivotTables share the same data source.
Manually Configure Slicer Connections
Since Office Scripts currently do not support recording this specific action, the best approach is to manually link the slicer to your PivotTables using built-in settings.
Excel's Action Recorder has limitations and cannot capture every user interface interaction. Connecting multiple PivotTables to a single slicer is one of these unsupported actions in Office Scripts for Excel for the web.
Click anywhere on the slicer that you want to connect to multiple PivotTables. This will reveal the 'Slicer' tab on the Excel ribbon.
Navigate to the 'Slicer' tab in the ribbon and click on 'Report Connections' (or 'Slicer Connections' depending on your Excel version).
In the dialog box that appears, check the boxes next to all the PivotTables you want this slicer to control.
Click 'OK' to apply the connections. Your slicer will now filter all the selected PivotTables simultaneously.

Manage Complex Data and PivotTables Easily with WPS Office
If you are frustrated by macro limitations in Microsoft Excel, consider trying WPS Office. It provides a highly compatible, lightweight, and completely free alternative for managing complex spreadsheets, PivotTables, and data visualizations without unexpected recording failures.
- 1. Download and Install: Visit the official WPS website, download the free installer, and complete the quick installation process.
- 2. Open Your Excel File: Launch WPS Spreadsheet and open your existing .xlsx file containing the PivotTables.
- 3. Manage Data Smoothly: Enjoy a fast, intuitive environment for all your data analysis and charting needs.

Frequently Asked Questions
Why doesn't the Action Recorder capture my slicer connections in Excel?
Currently, Office Scripts in Excel for the web lack the underlying API support to record the specific action of connecting a slicer to multiple PivotTables. It is a known limitation of the script recorder.
Can I write a custom VBA macro instead of using Office Scripts?
Yes, if you are using the desktop version of Excel, VBA (Visual Basic for Applications) fully supports automating slicer caches and connections. However, VBA does not run in Excel for the web.
Do slicer connections work the same way in Excel for the web and desktop?
Yes, the manual process of managing Report/Slicer Connections operates similarly across both platforms, though advanced automation like Office Scripts is primarily tailored for the web and Microsoft 365 environments.




