logo
search
OneDrive Error Codes

How to Fix 401 Error When Power Automate Opens Excel in OneDrive

WPS Content ManagerWPS Content Manager Sep 28, 2026 868 views

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.

How to Fix a 401 Error When Power Automate Opens an Excel File 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.
Before you start

Verify that your Microsoft account password has not recently expired or been changed, as this instantly invalidates active Power Automate connections.

Solution 1Recommended

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.

1
Access Power Automate

Log in to your Microsoft Power Automate dashboard using the account associated with the failing flow.

2
Navigate to Connections

On the left-hand navigation menu, expand the 'Data' tab and click on 'Connections'.

3
Locate the Excel and OneDrive Connectors

Find the 'Excel Online (Business)', 'Excel Online (OneDrive)', and 'OneDrive for Business' connections used by your flow.

4
Update the Connection

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.

5
Test the Flow

Go back to your flow, click 'Test' in the upper right corner, and run it manually to verify that the 401 error is resolved.

Refresh and Re-authenticate Your Power Automate Connections
Tip: If you frequently experience expiring tokens, check with your IT administrator to see if there are strict conditional access policies forcing frequent re-authentication on your tenant.
Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS Office website and download the free installer for your operating system.
  2. 2. Install the Software: Run the setup file and follow the on-screen instructions to install WPS Office on your device.
  3. 3. Open Your Spreadsheets: Launch WPS Spreadsheets and easily open, edit, and save your existing Excel workbooks.
Fully compatible with Microsoft Excel (.xlsx, .xls, .csv) formats.Lightweight architecture ensures fast performance without heavy cloud dependencies.A completely free alternative to expensive Microsoft 365 subscriptions.Familiar user interface makes migration and offline data analysis seamless.
QA img-9

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.