Can I create a workbook with Excel javascript add in?

浪尽此生 提交于 2019-12-11 05:06:21

问题


Is there any equivalent for Excel javascript add-ins to do what we can do in Word with context.application.createDocument() ? I don't see any create method in Excel Application object.


回答1:


The API for Excel is now under previewing, you can try to call through this way: context.application.createWorkbook(base64);




回答2:


As @MSFT-Jipyua mentioned, createWorkbook() is currently in "Preview" as part of v1.8. As it is in preview Preview (1.7 was just released in May and is rolling out to clients now) so keep in mind that this API won't work with all builds and platforms supported by Excel.

In order to call this API, you need to use the beta library release. This is hosted at https://appsforoffice.microsoft.com/lib/beta/hosted/office.js. You'll need to switch any references to the production library (https://appsforoffice.microsoft.com/lib/1/hosted/office.js) to the beta library in order to access preview functionality.



来源:https://stackoverflow.com/questions/50550472/can-i-create-a-workbook-with-excel-javascript-add-in

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