Search code examples
exceliframeembed

Embed Excel Sheet in Website - Element is not present Error


so I'm trying to embed an Excel Sheet in my website. I use Office Business, uploaded the file via onedrive and did the steps provided by microsoft. In office online I clicked on file -> share -> embed and copied the generated iframe.

The following error shows up: "Unfortunately, that didn't work out. The element is not present. It may have been deleted by another user." Error Message

Well the file is present and not deleted.


I tried a workaround and uploaded the file to sharepoint, clicked on share -> everyone with the link can edit -> copied the link and put it in the iframe previously generated by Excel.

Now this actually works... almost. Because as soon as the viewport width is smaller than 1260px the iframe breaks and shows an error message: "The file was not found. The URL of the original file is invalid or the document is not released for public access.". Error Message

When I stretch the width of the viewport to > 1260px the iframe works just fine again...

Sharepoint settings are "least restrictive".

The iframes:

iframe generated by excel:

<iframe width="402" height="346" frameborder="0" scrolling="no" src="https://company.sharepoint.com/sites/test/_layouts/15/Doc.aspx?sourcedoc={13cea024-ca40-2381-1c37-03450c02a321}&action=embedview&wdAllowInteractivity=False&wdHideGridlines=True&wdHideHeaders=True&wdDownloadButton=True&wdInConfigurator=True&wdInConfigurator=True&edesNext=false&ejss=false"></iframe>

Sharepoint Link:

<iframe style="position: absolute; height: 800px; width: 100%; border: none" frameborder="0" scrolling="yes" src="https://company.sharepoint.com/:x:/s/test/EZSgzhdAyoABjDcDRQwFoxEBVDDhbQ21L21WLgVFqOvKsQ?e=aQ1Y2Q&action=embedview&wdAllowInteractivity=False&AllowTyping=True&wdHideGridlines=True&wdHideHeaders=True&wdInConfigurator=True&edesNext=false&ejss=false&ActiveCell=D8"></iframe>

Obviously I changed the links a bit for this post.

Any help is appreciated!


Solution

  • After trying multiple different iframes and also getting in touch with the Microsoft team I found out that the problem was caused by Shopware. I had to adjust the iframe for Shopwares viewport breakpoints and now it works like a charm.