Excel to PowerPoint using Office Javascript API

197 Views Asked by At

I'm developing add-in that copies data from Excel to PowerPoint for Office (office.js) but I can't get the opened PowerPoint presentation to write in it. I know that in the past it was not possible, but I thought that they improved the API, I have read the documentation, but I cannot find any solution. Have anyone from idea?

2

There are 2 best solutions below

0
On

The Office JavaScript API doesn't provide anything for that. Office web add-ins work for the currently opened document/presentation only and run in the browser sandbox where you can't perform IO operations with local files except the sandbox. Instead, you may consider making a web API call where you could use the Open XML SDK for editing files on the server side. Also you may find the following articles helpful:

You can post or vote for an existing feature request on Tech Community where they are considered when the Office dev team goes through the planning process.

0
On

I'm not entirely clear on what your scenario is, but if the Excel workbook is stored on a SharePoint or OneDrive folder, you can have an add-in in PowerPoint use the Microsoft Graph APIs to open it and get data and paste the data into the open PowerPoint document. This sample does that: PowerPoint-Add-in-Microsoft-Graph-ASPNET-InsertChart.