How to Fix 401 Error When Power Automate Opens Excel in OneDrive
Question details
Users need to resolve a recurring 401 error in Power Automate when executing a flow that interacts with an Excel file stored in OneDrive.

- Product
- Power Automate, Microsoft Excel, OneDrive
- Device & OS
- not provided
- Scenario
- A user has set up a Power Automate flow to open and update an Excel workbook in OneDrive, but the flow begins to fail with an authentication error after working initially.
- Observed behavior
- The flow runs successfully for several iterations but eventually returns a 401 (Unauthorized) authentication error, halting the workflow.
Verify that your Microsoft account password has not recently expired or been changed, as this instantly invalidates active Power Automate connections.
Refresh and Re-authenticate Your Power Automate Connections
Since a 401 error indicates an unauthorized request, re-authenticating the specific connections used in your flow often restores proper access to OneDrive and Excel.
Power Automate relies on authentication tokens to access external services like OneDrive and Excel Online. If these tokens expire, get corrupted, or are invalidated by security policies, the workflow will throw a 401 error. Manually updating the connection forces a new, valid token to be generated.
Log in to your Microsoft Power Automate dashboard using the account associated with the failing flow.
On the left-hand navigation menu, expand the 'Data' tab and click on 'Connections'.
Find the 'Excel Online (Business)', 'Excel Online (OneDrive)', and 'OneDrive for Business' connections used by your flow.
Click the three dots (More commands) next to the connection, select 'Update' or 'Switch account', and re-enter your credentials to refresh the authentication token.
Go back to your flow, click 'Test' in the upper right corner, and run it manually to verify that the 401 error is resolved.

Escalate to the Microsoft Power Platform Community
If standard re-authentication does not resolve the problem, the issue might involve deeper workflow bugs, API changes, or complex tenant-level permission conflicts that require specialist intervention.
Try WPS Office for a Streamlined Spreadsheet Experience
Dealing with complex automated workflows, token expirations, and 401 errors in cloud-dependent ecosystems can disrupt your productivity. If you are looking for a reliable, fast, and free spreadsheet tool that doesn't rely on complicated cloud connections to get work done, WPS Office is an excellent alternative. It offers a familiar interface and seamless document management.
- 1. Download the Installer: Visit the official WPS Office website and download the free installer for your operating system.
- 2. Install the Software: Run the setup file and follow the on-screen instructions to install WPS Office on your device.
- 3. Open Your Spreadsheets: Launch WPS Spreadsheets and easily open, edit, and save your existing Excel workbooks.

Frequently Asked Questions
What does a 401 error mean in Power Automate?
A 401 error translates to 'Unauthorized'. It means Power Automate attempted to access an Excel file or OneDrive directory but was denied because the connection lacks the proper authentication tokens or permissions.
Why does my flow work initially and then suddenly fail with a 401 error?
This commonly happens when the authentication token used by the connector naturally expires, or when an organization's security policies force a session timeout, requiring the connection to be manually refreshed.
Can a password change cause a 401 error in my flow?
Yes. If you change the password for the Microsoft account running the flow, any existing Power Automate connections tied to that account will become invalid immediately, resulting in a 401 error.
How do I prevent permission errors when sharing an Excel file used in a flow?
Ensure the Excel file is stored in a location where the account running the flow has persistent 'Edit' permissions, such as a Shared SharePoint Library, rather than a personal OneDrive folder that might have restricted sharing settings.




