• Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

80
Views
Is there any way to have event handling with ExcelScript (Excel for web)

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

9 months ago · Juan Pablo Isaza
2 answers
Answer question

0

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 .

9 months ago · Juan Pablo Isaza Report

0

You can use the Excel Javascript API in Excel Online without writing an add-in from scratch. So you could us the trick you mention that formats a cell to look like a button, which I wrote. It requires the JADE addin, which works on Mac Windows and Online platforms and is free. It does not yet work for mobile versions, but you can run the Online version on most (all?) mobile platforms.

Using JADE, you could either format the cells to look like buttons on the sheet or have the code render a list of employees with actuall check-in / check-out buttons in the addin panel.

I'd be glad to write and example of either approach, but it probably should be in response to a questions specifically about how to do this with the JADE add-in. If you want such an example, post another question and link to in a comment to this answer and I'll write the example(s).

Discalimer: I wrote the JADE add-in.

9 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.