Home > Net >  Is there any way to have event handling with ExcelScript (Excel for web)
Is there any way to have event handling with ExcelScript (Excel for web)

Time:03-14

I am trying to create a "check in - check out" form to register the time in and out of workers at a company, using Excel for Web (ExcelScript). For every worker in the form, there has to be in the adjacent rows a Check IN and a Check OUT button that will stamp in the cell underneath the button the current time, and delete the button, as it was usually done with VBA macros.

In understand that buttons cannot be used from the javascript API but this answer has an interesting workaround using event worksheet.onSingleClicked() so the user would click on a cell that looks like a button, and it will call a function to stamp the current time and remove all button formatting.

The Excel Javascript API docs has the worksheet.onSingleClicked() or onChanged(), but I cannot find anything similar on the ExcelScript docs, which I understand is the only API that can run on Excel for Web.

Is there any way to create user interactable buttons in a for loop, or to register events (like onSingleClicked() or onChanged()) to be used in Excel for Web?

Thanks

CodePudding user response:

You need to add manually. New Office scripts are quite limited nowadays. But you may post a feature request for the team.

Feature requests on Tech Community are considered, when the dev team go through the planning process. Use the github label: “Type: product feature request” at https://aka.ms/M365dev-suggestions .

  • Related