Resolve SharePoint Embed 401 and 404 Errors for Excel Files
Question details
The user needs to embed an Excel spreadsheet into a SharePoint site without encountering 401 Unauthorized, 404 errors, or refused connection messages.

- Product
- Microsoft Excel / SharePoint
- Device & OS
- not provided
- Scenario
- Embedding an Excel spreadsheet hosted on OneDrive or SharePoint into a SharePoint site using an iframe or embed link.
- Observed behavior
- The embedded Excel file briefly displays its data, then returns a 401 Unauthorized error, a 404 error, or a message stating the site refused to connect.
Verify that you are logged into your organization's Microsoft 365 account and that third-party cookies are enabled in your web browser to allow cross-site authentication.
Store the Excel File in the Same Microsoft 365 Tenant
Embedding files from a personal OneDrive account into a business SharePoint site causes 401 Unauthorized errors because the personal account is treated as an external user.
SharePoint has strict security policies that prevent mixing personal and enterprise data environments. If your file is on a personal OneDrive account, SharePoint will refuse to display it to business users.
Log in to office.com using your official work or school Microsoft 365 credentials.
Open OneDrive for Business or the SharePoint Document Library where you want the file to live, and upload your Excel spreadsheet there.
Right-click the newly uploaded file, select Share, and generate a new sharing link to use for your SharePoint embed.

Use Native Excel Embed Tools Instead of Manual Iframes
Manually wrapping a standard sharing link into an HTML iframe often breaks authentication tokens, leading to 404 or refused connection errors.
Verify SharePoint Admin HTML Field Security
Your organization's SharePoint settings might block embedded content from certain domains, causing the iframe to fail to load entirely.
Simplify Spreadsheet Management with WPS Office
Dealing with complex SharePoint tenant permissions, 401 errors, and rigid iframe codes can be frustrating. WPS Office offers a free, lightweight alternative that makes creating, editing, and sharing spreadsheets incredibly simple without restrictive enterprise embed hurdles.
- 1. Download and Install: Download WPS Office for free from the official website and install it on your device.
- 2. Open Your Spreadsheet: Launch WPS Spreadsheets and open your existing .xlsx file without worrying about format loss.
- 3. Share via Link: Click the Share button in the top right corner to instantly generate a secure, universally accessible sharing link via WPS Cloud.

Frequently Asked Questions
Why does my embedded Excel file briefly flash before showing a 401 error?
The iframe initially loads the basic viewer structure, but when it attempts to fetch the actual file data, SharePoint recognizes a permission mismatch (like using a personal OneDrive link on a business site) and blocks access.
How can I fix the 'SharePoint site refused to connect' error in my iframe?
This is usually caused by browser security settings blocking third-party cookies or cross-site tracking. Try accessing the page in a different browser, or ensure that third-party cookies are allowed for Microsoft domains in your browser's privacy settings.
Can external users view an embedded Excel file on SharePoint?
Only if your organization's SharePoint site is configured to allow external sharing, and the Excel file's specific sharing link is set to 'Anyone with the link can view'. If the file is restricted to people within your organization, external viewers will receive a 401 Unauthorized error.




