Office Scripts triggered on sheet activation - to Refresh all data connections

Copper Contributor


I have recorded the below office script that refreshes all data connections. I want this script to run when a sheet named "Delivery date" is activated (i.e. when the user swaps from another sheet to this sheet)


It would appear that this is possible, as I found the below help article but I can't get it to work...


function main(workbook: ExcelScript.Workbook) {
  // Refresh all data connections
Thank for your help
1 Reply
The documentation you refer to pertains to the Office-JavaScript automation model, which is a different animal than Office Script. You would have to create an Office Add-in to be able to use those events.
For now, Office Script does not have any events I'm afraid.