Office Scripts and the main function

Office Scripts are an Excel automation tool in TypeScript, in Excel for the web. A script is a main function that receives an ExcelScript.Workbook object and acts on it. They are created with the action recorder or written in the code editor, are stored in the cloud and can be shared.

Example

function main(workbook: ExcelScript.Workbook) {
  workbook.getActiveWorksheet().getRange("A1").setValue("Hello");
}

Related concepts

The whole glossary