attachEvent
function attachEvent(eventName: string = null, callback: () = null): void
Description
Subscribes to the specified event and calls the callback function when the event fires.
Parameters
- eventName
string
null The event name.
- callback
()
null Function to be called when the event fires.
Returns
void
Try It
var oWorksheet = Api.GetActiveSheet();
var oRange = oWorksheet.GetRange("A1");
oRange.SetValue("1");
Api.attachEvent("onWorksheetChange", function(oRange){
console.log("onWorksheetChange");
console.log(oRange.GetAddress());
});