Streaming

If you want your function to update your cells with values automatically at a defined interval then the custom function needs to be streamed.
The updating of the values will happen without waiting for Excel or the user to request recalculation.
For example you might want to display the time in a cell that updates every second.


All streaming functions must include an "invocation" parameter which refers to the cell where the function was called from
The invocation parameter is used to update the contents of the cell at any time.



function method_to_call(increment, caller){ 
    var result = 0;
    setInterval(function(){
         result += increment;
         caller.setResult(result);
    }, 1000);
}

The final parameter "caller" is never specified in your registration code and it does not display in the autocomplete.
It is an object that contains a setResult callback function that is used to pass data from the function to Excel to update the value of the cell.
You must declare support for streaming in your function registration by setting the stream parameter to true.



© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext