In this repo you'll find the working solution code for the tutorial in:
Exporting Data with OpenXML Tutorial
The code is generated initially by the Open XML SDK Productivity Tool. This reflects C# code from a template document. This provides the base from which customizations can be made.
The worksheet generation is modified using snippets in this tutorial to build a table from Microsoft Graph generated JSON data.
Finally, the worksheet generation code is modified to "pin" (auto open) an Excel JS add-in to the workbook.
Please refer to the tutorial (linked above) for more details.