Microsoft KB Archive/277618

= XL2002: Calling a Server by Using the RealTimeData (RTD) Function =

Article ID: 277618

Article Last Modified on 1/29/2007

-

APPLIES TO


 * Microsoft Excel 2002 Standard Edition

-



This article was previously published under Q277618



SUMMARY
Microsoft Excel 2002 provides a new worksheet function called RealTimeData (RTD). This function allows you to call a Component Object Model (COM) Automation server so that you can retrieve data in real time. The RTD function has an optional argument for the name of the server. This article describes how this argument works.



MORE INFORMATION
When you use the RTD function, you specify the program ID of the registered COM automation add-in from which to retrieve the data. You can run the real-time data server on either the local computer or remotely.

Running the Server Locally
If you want to run the real-time data server locally, you can omit the server argument for the RTD function. The following example queries the locally registered COM add-in with the program ID of MyComAddIn.ProgID with the topic argument Current. =RTD(&quot;MyComAddIn.ProgID&quot;,,&quot;Current&quot;) The following example queries the local computer named Dixon and gives you the same result as the preceding example: =RTD(&quot;MyComAddIn.ProgID&quot;, &quot;Dixon&quot;, &quot;Current&quot;) If you use the RTD function in two different cells and each has the same arguments, one ConnectData call is made to retrieve the information. For example, if cells A1 and B1 each have the following formulas A1  =RTD(&quot;MyComAddIn.ProgID&quot;,,&quot;Current&quot;) B1  =RTD(&quot;MyComAddIn.ProgID&quot;,,&quot;Current&quot;) then only one call is made. However, if one cell uses the server argument and the other one does not, as shown in the following example, two ConnectData calls are made to the server: A1  =RTD(&quot;MyComAddIn.ProgID&quot;,&quot;Dixon&quot;,&quot;Current&quot;) B1  =RTD(&quot;MyComAddIn.ProgID&quot;,,&quot;Current&quot;)

Running the Server Remotely
You must configure the RTD server on both the local client computer and the remote server to use the RTD server with Excel. The second parameter of the RTD function should specify the remote server on which the RTD server is installed: =RTD(&quot;MyComAddIn.ProgID&quot;,&quot;RemoteServer&quot;,&quot;Current&quot;)

