Create excel work book using bytes using Excel.js API

859 Views Asked by At

We have started a new feature to our product where user can interact through excel plug-in to use some of the product services. we opted of using Excel.js.

Following is one of the main feature which is important to us and didn't find in the Exceljs API's.

Server will be sending the byte format of the workbook to the js, and intention is to create workbook using byte. Is there any API which will help to create workbook using byte format. Referred through the docs but didn't find any.

Other feature is, there will be a upload/save button and intention is to convert the existing workbook to bytes and send to server. Is there any API to convert working workbook to byte format.

Please include this feature in future release if not exists, it will be so helpful. if exists please advice.

Thanks in advance!!

2

There are 2 best solutions below

0
On BEST ANSWER

@MSFT-Jipyua has a good answer for getting the file. To send the file as bytes use the getFileAsync method, which is in the Common Office JavaScript APIs, not the Excel-specific APIs like createWorkbook.

6
On

please use the Excel.createWorkbook(base64) API which accepts a base64 encoded string representation of your workbook. And this API belongs to API version 1.8 which has just been officially shipped.