Fix Office Script Permission Error When Refreshing External Workbook Links
Question details
The user encounters a permission error when trying to refresh external workbook links using an Office Script triggered by Power Automate.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Running an automated workflow in Power Automate that calls an Office Script to refresh external links in a linked Excel workbook.
- Observed behavior
- The Office Script fails and returns an error stating that the user has not granted permission to refresh external workbook links.
Ensure that both the primary Excel workbook and the linked external workbooks are stored in a centralized cloud location (like SharePoint or OneDrive) and that your account has full edit access to all involved files.
Manually Grant External Link Permissions in Excel for the Web
Since Office Scripts run in the cloud, you must first manually open the file in Excel for the Web to grant initial permission to external data sources before automation can succeed.
Power Automate runs Office Scripts silently in the background. If a workbook contains external links that have never been refreshed in the cloud, Excel blocks the script for security reasons until explicit user consent is given.
Navigate to SharePoint or OneDrive and open the primary Excel workbook in Excel for the Web.
Go to the 'Data' tab on the ribbon and click 'Refresh All'. This will prompt a security warning about external links.
Click 'Allow' or 'Enable Content' on the security prompt to explicitly grant the workbook permission to access external links.
Save the workbook, return to Power Automate, and re-run your flow to verify that the Office Script now executes without permission errors.

Seek Scenario-Specific Support in the Microsoft Community
If the permission error persists after manual approval, the issue may require advanced workflow troubleshooting in the official Microsoft Power Automate Community.
Try WPS Office for Seamless Spreadsheet Management
If you are tired of complex cloud permission barriers and automation errors in Microsoft 365, consider switching to WPS Office. It provides a lightweight, highly compatible alternative with robust support for managing local and network workbooks without restrictive cloud prompts.
- 1. Download WPS Office: Visit the official WPS website and download the free WPS Office installer.
- 2. Open Your Workbooks: Launch WPS Spreadsheet and open your existing Excel workbooks seamlessly.
- 3. Manage Data Connections: Use the Data tab to directly manage and update external data links without complex cloud permission barriers.

Frequently Asked Questions
Why do I get a permission error when refreshing external links via an Office Script?
Microsoft Excel requires explicit user consent to pull data from external sources. Because Office Scripts run in the background via Power Automate, they cannot display this prompt to you, resulting in an automatic failure if permissions haven't been previously granted.
Can Power Automate completely bypass the Excel external link security prompts?
No. Security settings in Microsoft 365 generally prevent automated scripts from bypassing manual permission prompts for external data connections to protect against unauthorized data access.
How can I check if my workbook contains broken external links?
In Excel, go to the 'Data' tab and click 'Edit Links' (or 'Queries & Connections'). This dialog will list all external sources connected to the workbook and their current update status.
Does WPS Office support updating external spreadsheet links?
Yes, WPS Spreadsheet fully supports creating, managing, and refreshing external data links between local or network-hosted workbooks, often with a simpler approach to connection management.




