I'm currently investigating whether it's possible to port a VBA addin I maintain, to a web-based Office addin. The purpose of my existing addin is to create queries which can be refreshed to pull live report data into the worksheet from the web front end of a database application.
In VBA I can do this quite simply with QueryTables:
Set Query = ActiveSheet.QueryTables.Add(Connection:=FullURL, Destination:=ActiveCell)
The JavaScript API documentation mentions the Excel.Query class which represents a Power Query query, but the properties and methods seem to be read-only and I see no mention of how to create one of these and add it to the sheet, only examine existing ones. Is it yet possible to create a new query using Office JS? Alternatively, can I achieve my goals using a different type, like LinkedData or DataConnection?
There are no API in Office JavaScript Library to enable creating/writing Power Queries. It may be added someday if there is sufficient demand, but that will be at least a year from now. Please suggest this at Microsoft 365 Developer Platform Ideas.