Forum Discussion
OneDrive no longer creating functional iframe sharing links
Your OneDrive/Excel iframe problem is almost certainly due to Microsoft’s change in how Excel files can be embedded. The old method of using a standard share link inside an <iframe> no longer works reliably. Microsoft now requires you to use a dedicated embed code generated from within Excel Online.
What’s going wrong
- A normal Share → Copy link URL (e.g., https://onedrive.live.com/view.aspx?resid=...) is not designed for iframes anymore. It may be blocked by security headers (X-Frame-Options or Content-Security-Policy) or simply not return the embeddable viewer.
- The correct URL for embedding contains /embed? and specific parameters like em=2. Without those, the iframe remains blank.
The correct fix
- Open your Excel file in Excel Online (via OneDrive in the browser).
- Go to File → Share → Embed.
- Click Generate to get the full <iframe> code.
- Copy that entire code and paste it into your website or HTML.
That code will look something like this:
<iframe width="600" height="400" frameborder="0" scrolling="no" src="https://onedrive.live.com/embed?resid=YOUR_RESID&authkey=YOUR_AUTHKEY&em=2&wdAllowInteractivity=False&wdDownloadButton=True"></iframe>
The key difference is the src contains embed instead of view, and includes em=2 (or similar). This tells Microsoft to serve the embeddable version of the workbook.
Why your fresh-file test failed
You uploaded a new copy, shared it correctly, and even tried embedding a specific tab. But you likely still used a share link rather than the Embed option. The permissions were fine; the URL was just wrong for iframes.
Important caveat: embedding a specific sheet/range may still break
Even when you use the correct Embed feature, the parameter Item= (used to display only a particular worksheet or range) has had reported issues recently. If your iframe is blank only when you try to embed a specific tab, but works when you embed the whole workbook, that’s a known Microsoft bug. Try embedding the whole workbook first to see if that works.
How to diagnose further
If the correct Embed code still shows a blank iframe, do this test:
- Copy the src URL from the generated iframe code.
- Open that URL directly in an Incognito/InPrivate window while logged out of Microsoft.
- Note what happens:
- A. Excel appears normally → problem is with your website (CSP, iframe restrictions).
- B. Login prompt → sharing permissions are not set to “Anyone with the link”.
- C. Error message → the embed URL or file is problematic.
- D. Blank page → Microsoft’s embed service may be down or the URL is malformed.
- E. Workbook appears but wrong sheet → Item= parameter issue.
- F. Something else → describe it.
Also tell us whether you’re using OneDrive Personal or OneDrive for Business/SharePoint, because the hostname and behavior differ.
Bottom line
Always use File → Share → Embed to get the iframe code. That is the supported method. If that still fails, the problem is either with a specific sheet embedding (Item=), Microsoft’s service, or your website’s security settings—not your file permissions.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and like it!
This will help all forum participants.
I have pretty much the same issue, but using powerpoint embed URLs . I have embedded about 40+ different URLs to Powerpoint presentations on my GoogleSite using the embed iframe code which I had previously generated from each file. Up until recently everything worked fine and all powerpoints showed up in the browser. Since ca 1 week not a single one of these powerpoints shows up anymore - only blank space. I have thousands of people around the world using these resources for teaching. It is very frustrating. I also have re-generated several of these embed codes, but the problem persists. It clearly seems to be some sort of Microsoft service issue, because everything worked smoothly before.