This script takes a value from cell into a variable:

  • function main(workbook: ExcelScript.Workbook) {
      // Get the active worksheet.
      let myvariable = workbook.getActiveWorksheet().getRange(“A1”).getValue();
      console.log(myvariable);
    }