Assign script to on-click button
Description:
In the usual VBA enviroment for MS Excel, a developer can create a service by writing a macro, and then assign the macro to a button. In such a way an end-user does not need to enter the "Developer" tab and run the script, but can only click on the button and then have the macro executed.
Is there a way to assign a script lab code to a button? It would enormously increase the usage of script lab for end-user services.
Is it possible to assign function execution when an element in the spreadsheet is clicked, hovered or edited? As @t-1910 said, we need to have seamless integration of user interactions with spreadsheet elements and JavaScript code execution. Trying to direct users to use ScriptLab pane is not the way to go, as they are not used to something like that. Users want to click a button/chart/cell in the spreadsheet and see things happen. At the moment the spreadsheet structure and Script Lab pane are totally decoupled from each other in terms of UI.
NB: It would be great if we could create Ribbon tabs/buttons that execute JS code/functions. As for graphics assets for icons, those can be embedded in JS code as SVG or PNG-Base64 for example.
This is a great suggestion!
You can do this with Office Scripts.
However, the core purpose of Script Lab is to allow people to experiment with office.js APIs.