Embed SharePoint Online Files in an External Website
Question details
The user needs to display a SharePoint Online document or workbook inside an external website.

- Product
- SharePoint Online and Microsoft Office for the web
- Device & OS
- not provided
- Scenario
- A file stored in SharePoint Online needs to be embedded in an external website using an iframe.
- Observed behavior
- The file may not display in the iframe when guest access, sharing settings, or organization policies restrict access.
Confirm that you can open the file in Office for the web and have permission to share it. Ask your SharePoint administrator which external sharing options are approved for the site.
Generate an embed code in Office for the web
Use the file's embed option when it is available for the file type and your organization's policies allow the intended audience to view it.
In the SharePoint document library, select the document or workbook and open it in Office for the web.
Select File > Share > Embed, if available, and follow the prompts to generate the embed code.
Copy the generated code and paste it into the external website's HTML or embed component.
Open the published page in a separate browser session and check whether an intended viewer can see the file or is prompted to sign in.

Check external sharing permissions with an administrator
Use this approach when the embed is blocked by guest access or sharing restrictions.
Edit Office documents and workbooks with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with Office files. Its format compatibility helps you move existing documents and workbooks into your workflow. SharePoint embedding and access policies still need to be managed in Microsoft 365.

Frequently Asked Questions
Why does my SharePoint iframe ask visitors to sign in?
The file or site may require authentication. Check the file's Share settings and ask your administrator whether the intended visitors are allowed guest access.
Where can I find the embed code for a SharePoint workbook?
Open the workbook in Excel for the web and look for File > Share > Embed. Availability can depend on the file and your organization's settings.
Can I put an Anyone sharing link directly into an iframe?
Not necessarily. An Anyone link controls access but may not be a supported iframe URL. Generate an embed code in Office for the web when the option is available.
Who can change external sharing settings?
A SharePoint administrator can review organization settings under Policies > Sharing and site settings under Sites > Active sites in the SharePoint admin center. Changes should follow the organization's security policy.




