OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
675 stars 95 forks source link

insertWorksheetsFromBase64 does not load excel if it contains chart data #4667

Closed ishanig11 closed 3 months ago

ishanig11 commented 3 months ago

insertWorksheetsFromBase64 API does not load excel if excel contains chart,pivot table data. API throws exception that this is not supported.

So we are planning to use Excel.createWorkbook to open new workbook. But with this API problem is that its opening in new tab and there is no way to get updated context so that our add-in thread can progress.

Can you please help me to solve this issue?

Thanks in advance.

shanshanzheng-dev commented 3 months ago

Hi @ishanig11, Thanks for reporting issue, you can check this link: https://learn.microsoft.com/en-us/javascript/api/excel/excel.workbook?view=excel-js-preview#excel-excel-workbook-insertworksheetsfrombase64-member(1), when I insert chart or pivot table, I can use insertWorksheetsFromBase64 API to create a new sheet.

ishanig11 commented 3 months ago

@shanshanzheng-dev : And what if your excel already contains chart? Are you able to load them?

shanshanzheng-dev commented 3 months ago

Yes, you can see this video, is that your want? If not, could you share your repro video? Thanks.

https://github.com/OfficeDev/office-js/assets/125014206/844244d7-b2e4-4baa-94d0-7cedbcad3cf0

ishanig11 commented 3 months ago

can you try to load workbook directly? And also include pivot table.

shanshanzheng-dev commented 3 months ago

@ishanig11 the first table you can see is pivot table, what do you mean "load workbook directly"? could you share your code? Thanks.

microsoft-github-policy-service[bot] commented 3 months ago

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!

microsoft-github-policy-service[bot] commented 3 months ago

This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.