I want to embed an Excel sheet with formulas and some calculation to a Wordpress site. I managed to setup and display the sheet and able to interact with it live on my site. The guide I used to embed is as follows: https://support.office.com/en-us/article/Share-it-Embed-an-Excel-workbook-on-your-web-page-or-blog-from-OneDrive-804e1845-5662-487e-9b38-f96307144081?CorrelationId=2f1048d2-df73-470f-b3a5-c65576288a04&ui=en-US&rs=en-US&ad=US&ocmsassetID=HA102029502
我想在Wordpress站点上嵌入一个包含公式和一些计算的Excel表格。我成功地设置并显示了这个页面,并且能够在我的站点上与它进行实时交互。我所使用的指南如下:https://support.office.com/en- us/article/share-it -嵌入- excel -work - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Now, I just need one help that is to remove the bottom black bar that comes preloaded with the Microsoft embed code. Please refer below, where I have highlighted in red. The reason for me to remove that is to prevent users from downloading the Excel from my site.
现在,我只需要一个帮助,那就是删除预装微软嵌入代码的底部黑条。请参考下面,我用红色突出显示的地方。我删除它的原因是为了防止用户从我的站点下载Excel。
1 个解决方案
#1
1
I know is a really old question, but I hope this helps someone in the future: As you may realized when "inspecting" the element in the browser it happens that the excel embed has another iframe inside! This iframe has an ID called "WebApplicationFrame", and bottom bar is inside this second iframe.
I tried to add a "display: none" to the bar with JS to hide it, but for some reason it doesn't work. So the way I achieved this was doing bigger the height of "WebApplicationFrame":
我知道这是一个非常古老的问题,但我希望这对将来的某些人有所帮助:正如您可能会意识到,当在浏览器中“检查”元素时,恰好excel内嵌有另一个iframe !这个iframe有一个名为“WebApplicationFrame”的ID,在第二个iframe中有一个底部条。我试图在带有JS的bar中添加一个“display: none”来隐藏它,但出于某种原因,它不起作用。所以我实现这个的方式是做更大的“WebApplicationFrame”的高度:
<iframe id="excel-iframe" scrolling="no" src="YOUR_EXCEL_EMBED_URL" width="600" height="500" frameborder="0"></iframe>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("#excel-iframe").load(function() {
$(this).contents().find("#WebApplicationFrame").css("height", "550px");
});
});
</script>
Notice in my code that the iframe where you are embedding the excel has a height of 500 (pixels) and in the Javascript code I'm giving the iframe within a height of 550px. This way the bottom bar of the internal iframe is out of viewport.
请注意,在我的代码中嵌入excel的iframe的高度为500(像素),在Javascript代码中,我给出的iframe的高度为550px。这样,内部iframe的底栏就不在viewport了。
Now, maybe you don't care about hiding the bottom bar and you may only want to disable the "download" button. If you watch your embed URL there's a part in it which says:
现在,您可能不关心隐藏底部栏,您可能只想禁用“下载”按钮。如果你看你的嵌入URL里面有一个部分写着:
&wdDownloadButton=True
you just need to change True for False and the download button will be disabled:
您只需要更改True为False,下载按钮将被禁用:
&wdDownloadButton=False
#1
1
I know is a really old question, but I hope this helps someone in the future: As you may realized when "inspecting" the element in the browser it happens that the excel embed has another iframe inside! This iframe has an ID called "WebApplicationFrame", and bottom bar is inside this second iframe.
I tried to add a "display: none" to the bar with JS to hide it, but for some reason it doesn't work. So the way I achieved this was doing bigger the height of "WebApplicationFrame":
我知道这是一个非常古老的问题,但我希望这对将来的某些人有所帮助:正如您可能会意识到,当在浏览器中“检查”元素时,恰好excel内嵌有另一个iframe !这个iframe有一个名为“WebApplicationFrame”的ID,在第二个iframe中有一个底部条。我试图在带有JS的bar中添加一个“display: none”来隐藏它,但出于某种原因,它不起作用。所以我实现这个的方式是做更大的“WebApplicationFrame”的高度:
<iframe id="excel-iframe" scrolling="no" src="YOUR_EXCEL_EMBED_URL" width="600" height="500" frameborder="0"></iframe>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("#excel-iframe").load(function() {
$(this).contents().find("#WebApplicationFrame").css("height", "550px");
});
});
</script>
Notice in my code that the iframe where you are embedding the excel has a height of 500 (pixels) and in the Javascript code I'm giving the iframe within a height of 550px. This way the bottom bar of the internal iframe is out of viewport.
请注意,在我的代码中嵌入excel的iframe的高度为500(像素),在Javascript代码中,我给出的iframe的高度为550px。这样,内部iframe的底栏就不在viewport了。
Now, maybe you don't care about hiding the bottom bar and you may only want to disable the "download" button. If you watch your embed URL there's a part in it which says:
现在,您可能不关心隐藏底部栏,您可能只想禁用“下载”按钮。如果你看你的嵌入URL里面有一个部分写着:
&wdDownloadButton=True
you just need to change True for False and the download button will be disabled:
您只需要更改True为False,下载按钮将被禁用:
&wdDownloadButton=False