Please see Real Time Data in the User Guide for more details about writing RTD functions.
See also Worksheet Functions.
RTD
RTD is a base class that should be derived from for use by functions wishing to return real time ticking data instead of a static value.
See Real Time Data for more information.
value
Current value. Setting the value notifies Excel that the value has been updated and the new value will be shown when Excel refreshes.
connect
(self)Called when Excel connects to this RTD instance, which occurs shortly after an Excel function has returned an RTD object.
May be overridden in the sub-class.
@Since PyXLL 4.2.0: May be an async method.
disconnect
(self)Called when Excel no longer needs the RTD instance. This is usually because there are no longer any cells that need it or because Excel is shutting down.
May be overridden in the sub-class.
@Since PyXLL 4.2.0: May be an async method.
detach
(self)Detatches the RTD instance from any Excel RTD functions.
After detaching, any subsequent calls to the Excel RTD function that created this object will result in the Python function be re-run.
See Restarting RTD Functions for more details.
@Since PyXLL 5.9.0
IterRTD
(RTD)IterRTD implements the RTD base class and wraps a Python iterator.
This class creates a background thread and iterates over the iterator in that thread. Each value yielded by the iterator is sent to Excel.
In Python 3.7 and above, the background thread is run in the same context
as the calling thread (see contextvars
in the Python documentation
for details about contexts and context variables).
When writing an RTD generator (RTD Generators) this class is what is used
to wrap the generator object into an RTD
object.
__init__
(iterator, auto_detach=None)Parameters: |
|
---|
AsyncIterRTD
(RTD)AsyncIterRTD implements the RTD base class and wraps a Python async iterator.
This class iterates over the async iterator in PyXLL’s asyncio event loop. Each value yielded by the iterator is sent to Excel.
In Python 3.7 and above, the background thread is run in the same context
as the calling thread (see contextvars
in the Python documentation
for details about contexts and context variables).
When writing an RTD async generator (Async RTD Generators) this class is what is used
to wrap the async generator object into an RTD
object.
__init__
(iterator, auto_detach=None)Parameters: |
|
---|