Maurice Calvert

Building an Excel Real Time Data server: Providing easy-to-read function names, part 6

This is part 6 of the tutorial that describes the techniques necessary to build an Excel RTD server. If you have just come to this page, I suggest you read all parts in order, here is Building a Real Time Data for Excel, part 1.

Geeks like us have no qualms about typing =RTD(“Geodesix.RTD”,,”geocode”,”status”,”Tokyo”) in an Excel cell to get a value. Normal people find this a bit clumsy, and it would be nice to humour them.

Excel provides a way to this quite simply. We create a UDF called Geocode whose sole function is to compose the ghastly RTD formula and return that to Excel #15#.

The only fine point here is that the Geocode function has two options.

  1. Return the RTD formula. Excel will note this and continuously call the RTD module to obtain updates of the value
  2. Return an actual value. The UDF now behaves like any other non-volatile function: Excel will never call it again unless its arguments change.

Geodesix makes use of this to avoid being called a second time once a geocode has been resolved, on the reasonable assumption that once we have the latitude of a place, it’s not likely to change in the near future.

If you’re implementing a true real-time server, where values change continuously, your UDF must always return the =RTD() formula.

Building a Real Time Data for Excel tutorial:

Post a comment

Have any questions? Ask us right now!