0

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!!

madireddy
  • 107
  • 3
  • 13

2 Answers2

2

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.

MSFT-Jipyua
  • 391
  • 1
  • 6
  • Thanks. As a separate note I would like to know the Excel js only woks with office 365? Initially I tried with "Office Home & Student", the sample project add-on didn't execute. Later shifted to "Office 365", then add-on is working. Am I right? Any specific reason? – madireddy Oct 03 '18 at 18:11
  • I think this is because by Office 365 you can get the latest update which contains this API. You can call other old shipped APIs from "Office Home & Student" version but may not the latest one if the version is not uptodate. – MSFT-Jipyua Oct 08 '18 at 01:51
  • Able to create the workbook using Excel.createWorkbook(base64), but it's opening in new excel window. Expected is, it should open is the existing open workbook where the app is running @Taskpane. Any suggestions? – madireddy Oct 26 '18 at 12:39
  • This is the designed behavior, similar as UI File->New is doing. – MSFT-Jipyua Oct 27 '18 at 00:40
  • Is there a way I can open where the add-on is running. If it's opening as new file, the problem is the add-on which is running in other file need to send the opened file as bytes back to server. Is it possible? – madireddy Oct 29 '18 at 02:05
  • Not quite get your scenario. but you can send that file content(base64) to server side after calling the createWorkbook api? – MSFT-Jipyua Nov 15 '18 at 01:08
1

@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.

Rick Kirkham
  • 9,038
  • 1
  • 14
  • 32