The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Dear @Nirmal Mudaliar,
Thank you for posting your question in Microsoft Q&A.
Based on your inquiry, we understand that you need to embedded your Excel file in OneDrive within an <iframe> .We will be glad to assist you with this
Here is my following respond for your question
1.Is there any supported method to embed editable Excel files from OneDrive/SharePoint inside an <iframe> on a custom (non-Microsoft) domain?
Currently, I have not found any article from Microsoft that advises on setting editable mode in a custom application. Of course, your clients can make changes on your website, but these changes won't be reflected in the source file on OneDrive.
You can refer via this link: Linked objects and embedded objects - Microsoft Support
2.Can your domain be approved, whitelisted, or trusted to bypass this CSP restriction?
The core issue you're facing is Microsoft's Content Security Policy (CSP). More specifically, the frame-ancestors directive within that CSP is very strict and pre-defined by Microsoft.
It means:
- Microsoft has hard-coded a strict whitelist of domains that are permitted to embed Office Online applications (like Excel Online) within an <iframe>.
- This list only includes Microsoft's own domains (e.g., teams.microsoft.com, *.office.com, *.sharepoint.com, etc.).
- Your custom application's domain is not on this list.
3.Are there licensing tiers, SharePoint tenant-level settings, or enterprise agreements that allow iframe embedding?
By design, SharePoint Online doesn’t allow to access its pages via <iframe > from an external application. This header is a critical security measure designed to prevent security vulnerabilities such as clickjacking.
In my perspective, CSP with great care to safeguard your main data and private information from being compromised or stolen. Due to this fundamental security objective, Microsoft currently may not supply alternative solution to the CSP for your custom domain.
Please correct me if I misunderstand your request.
If you need further assistance, please let us know.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.