You can subscribe to data with RTW using the RTW COM Server (rts) and the RTD function. The RTD function is an Excel function available in Microsoft® Excel 2002 or higher. The RTD function retrieves real-time data from any program that supports COM automation such as RTW. Please see the Microsoft® Excel Help for more information on COM automation.
RTW offers three menu options that facilitate building an RTD formula for subscribing to data.
These options are:
To learn more about these options, click on the relevant engine link listed at the bottom of this topic.
The generic syntax for Microsoft® Excel RTD is as follows:
=RTD(ProgID, server, topic1, [topic2], …)
When using RTW to subscribe to data, the RTD function uses the following arguments:
=RTD(ProgId, server, command, engine, servicename, recordname, fieldname1, […, fieldnameN])
The arguments have the following meaning:
Argument | Explanation |
---|---|
ProgID | The name of the RTW RTD Server, Vistasource.RtdServer. |
Server | Remains null. |
Command | “rt”, to indicate the subscribe command. |
Data Range | The cell or cell range containing the value(s) to publish. |
Engine | The RTW engine that will do the subscribing, e.g. vsRMDS (RMDS SFC), vsRMDS2 (RMDS RFA), axbloom (Bloomberg), vsnf (Netfeed), rthttp (WebData). |
Servicename | The name of the service to which you are subscribing. For Bloomberg, this references the Record Type. |
Recordname | The name of the record to subscribe to. |
Fieldname1 | The name of the first field, such as BID or ASK. |
FieldnameN | The name of the last field. |
Example of an RTD function for subscribing: The following formula subscribes to the Microsoft ASK price via the RMDS (RFA) engine with the IDN service:
=RTD("Vistasource.RtdServer",,"rt","vsRMDS2","IDN","MSFT.O", "ASK")
Example of an RTD function for subscribing to multiple fields:
To retrieve multiple field values with one formula, the RTD function would need to return an array of data. However, RTD does not support this functionality (see Microsoft KB article 286258). To work around this limitation, the RTW wrapper function PARSE_DATA can be used. This function “parses” the string array of incoming data. See RTW Functions for more information. The Quote dialogs will automatically use the PARSE_DATA function when creating array formulas.
The following formula subscribes to the Microsoft ASK and BID prices in real-time via the RMDS (RFA) engine with the IDN service:
{=PARSE_DATA(RTD("vistasource.rtdserver",,"rt","vsRMDS2","IDN","MSFT.O","ASK","BID"))}