November 14, 2024
Author: Alina As we continue to iterate and enhance the ito. We strive to provide users with customiz solutions to meet their specific nes. ONLYOFFICE macros are one of these powerful customization tools. In this article, we will introduce the attachEvent method and explain how it works with macro code events, as well as provide a script example that runs two independent macros in one execution.
Use the attachEvent method to handle events in your macro code
About the attachEvent method
This method listens for a specific singapore whatsapp number data event and once the event is trigger, calls the callback function, allowing us to execute additional scripts in the callback. The following is an example of using the onWorksheetChange event:
Use the attachEvent method to execute two macros in one run
The first part of the script will use the Import CSV macro to read data from an external CSV file and import it into the table. The second part, which is execut in the callback function, is responsible for calculating the sum of a specific column and displaying the result.
So, first we import the external CSV file and fill the table with data
At ONLYOFFICE, we are adb directory always striving to improve the flexibility and versatility of our products. ONLYOFFICE macros are a great tool that allows you to customize functionality to meet specific nes. Our rich, continuously updat API library will help you create your own solutions.
We invite you to use this benefits of open access publishing increased collaboration among researchers resource to create your own macros. If you have any questions or a macro you would like to share, please feel free to contact us. We look forward to working with you.
At the end of the macro, we call the asc_calculate function to reload the spreadsheet and display the calculation results in the select cell:
Next, we call the LoadFile function and execute the attachEvent method to listen for any changes on the worksheet. Once a change is detect, the calculateSum() function will be trigger and execut in the callback: