There is a section in the documentation which says to use Office.addin.setStartupBehavior(Office.StartupBehavior.load); to make an add-in load when a document opens. However, where in my project should I call this? I've tried putting it in ./src/functions/functions.js, ./src/commands/commands.js, and ./src/taskpane/taskpane.js. However, it never seems to be executed since calling let behavior = await Office.addin.getStartupBehavior(); yields none. Moreover, the following in my ./src/commands/commands.js is never executed:
Office.onReadt(async () => {
let context = new Excel.RequestContext();
context.workbook.worksheets.getActiveWorksheet().name = "test";
await context.sync();
});