Ability to open/replace workbook with Excel JS API in a similar way Word API can with insertFileFromBase64
We have a requirement to load a workbook from a remote source from within the add-in. User logs in, selects from a list and workbook template loads.
With the Word JS API we can load a template remotely using an AJAX call that returns the workbook as a base64 string and then insert the response into the current workbook using the replace option. AFAIK this doesn't exist for the Excel API and we download the workbook and then instruct the user to open from the download pane.
The API is in preview for Excel Desktop and Mac now!
This feature is not be able to GA due to this API is not available on Excel online due to the Excel online cannot insert worksheet from the external workbook, so Team is now working on investigating on Excel online. and figure out the features that we can support now and our strategy is to build addFromBase64 for Excel Online with a limited supported feature, which allow us to GA this API. and then we will continue iterating this API to support more features
For Excel Desktop and Mac beta preview. you could use our Beta CDN, more info on this here https://aka.ms/excelapiopenspec
Here is a sample code snippet using the API
key line of code context.workbook.worksheets.addFromBase64(mybase64)
send an xlsx (base64 encoded)
please use it and send us feedback!
Cory Isaacson commented
This will be a very important feature. It is also important to be able to load a sheet into a workbook using Open XML so that the application can provide this on the fly.
Adin Schmahmann commented
Additionally, aside from inserting the workbook from a base64 string it would be quite useful to insert the workbook from OOXML and generally Get/Set Excel (and PowerPoint) content from OOXML
We would like something like insertSheetFromBase64; which would also require method to getSheetBase64. Would include all sheet content, including images, rangeNames, formatting, charts, etc.