Search code examples
c#rtd

RTD Server Structure


I've developed a C# program that is subscribing to live FX prices from a bank, I'm using a udpclient to broadcast these messages and then have a RTD server library displaying these in Excel. Is this structure correct or have I completely missed the point of RTD servers? Is there a more elegant way to structure this process?


Solution

  • As far as I remember, no, there's no other way.

    Excel requires an RTD plugin (server) that will be loaded by name when the spreadsheet references rtd data. Then data observers will be registered/unregistered on per-cell basis.

    On the other hand, to pull data through the internet, you need some XYZ-Client, be it TCP, UDP, WS, or whatever else protocol you need. It must listen to messages or poll and detect changes and then cache the data and notify the RTD infrastructure that the data needs to be refreshed in Excel.

    Something like 0.5 or 2.0 times per second, Excel will check for updates and update the cells and formulas.

    That's exactly how RTD infrastructure works here, nothing nicer..

    The only other ways of streaming live data to Excel are:

    • sharing data with another app through DDE (I've read that it's easier to implement, but slower in overall performance)
    • writing a set of macros that will, well, overwrite specific cells of the spreadsheets (many times slower and uglier)