Can we load Excel file in Office.js Add-in

后端 未结 2 1433
夕颜
夕颜 2020-12-21 18:39

I am trying to load a Excel file in Excel online.

By loading a file I mean lets say I receive an Excel file from a service which I need to show on the current workbo

2条回答
  •  爱一瞬间的悲伤
    2020-12-21 19:14

    Add-ins are scoped to the document and are intended to extend the functionality of the Office application, not as a mechanism for opening documents themselves.

    What you're describing is what WOPI is intended for. The WOPI protocol provides an interface between Office and the document storage.

    While you can implement your own WOPI client, it isn't a trivial process. A far simpler approach is to leverage the user's OneDrive via Microsoft Graph. Files stored in OneDrive include a webUrl property. If you open this URL it will automatically open the file in the correct application (Excel, Word, etc).

提交回复
热议问题