Excel JS Add-In works in Excel but not Excel Online

孤人 提交于 2019-12-07 01:56:28
Michael Zlatkovsky - Microsoft

Taking a guess from looking at the manifest, I would guess that by "runs correctly in Excel 2016 on my machine", you mean that you can "F5" in Visual Studio and it runs correctly. Is that true?

Assuming my assumption is true... the reason it works on desktop through Visual Studio is that VS does a special F5 process where it automatically substitutes the relative web paths with the spun-up IIS location. But the manifest itself is not actually "valid" in that it doesn't have real URLs -- just things like "~remoteAppUrl/App/Auth/About.html" instead of "https://localhost:3000/App/Auth/About.html".

Two things you can do:

  1. Since you already are in Visual Studio, and if you have an Office 365 for Business tenant you could use the actual built-in feature for debugging in Excel Online. Just open the properties pane for the manifest project, and set the start action to Internet Explorer or Chrome. There is a brief mention of this on https://dev.office.com/docs/add-ins/get-started/create-and-debug-office-add-ins-in-visual-studio, search for "start action".

  2. As a more generic approach that works for other hosts (Word, PPT), and that doesn't require an Office 365 for Business account (regular OneDrive consumer would do), follow the steps outlined on my answer at https://stackoverflow.com/a/33155794/678505.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!