Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've gotten several emails regarding this post, so I figured I'd just
post my current work-around. The general idea of the work-around is to set up proxy subscriptions. For every dynamic topic that you want to have, you set up a proxy. To do this, I had to add a couple of extra calls to my dll. int GenerateProxyId(unique id) - This function generates a proxy id and binds it to some unique info. For my unique info, I use the workbook name + cell name of the thing that is calling GenerateProxyId. You need to do this so that when you open multiple workbooks in the same excel instance you don't get id conflicts between workbooks. DateTime AttachData(proxyId, data) - This is a call that I use to attach dynamic data to proxy ids. I return a DateTime because it is kind of useful to know when the last time your dynamic topic changed. I keep a hash of proxyId-last change time so that if AttachData gets called and it is the same data or there is an error condition or something, I can just return the last good date. I also added a special branch through my code to look for a special topic "proxy". So when I get a call like =RTD("My.RTD",,"proxy",3,"#bar") In this case, I would see that it was a special "proxy" topic using the proxyId 3. I would look up the proxy data 3 and find something like "dynamic-foo" and then attach it to the static part of the subscription "#bar" and get something like ("dynamic-foo", "bar"). By having the ability to combine static data with dynamic data, you can save some proxy/attachData calls. For instance, if you wanted to have 2 subscriptions (stock, "BID") and (stock, "ASK) where stock was a dynamic value, you would just have the following: =GenerateProxyId("my workbook.xls", "A5") -- 3 =AttachData( 3, stock) -- 12:03:05 =RTD("My.RTD",,"proxy",3, "#BID") =RTD("My.RTD",,"proxy",3, "#ASK") * I use the # symbol to indicate weather the proxied data should go #before or after# the static data. That's about it as far as the solution goes. It's a very painful way to do something that seems like it should be there out of the box. The code gets pretty ugly too. With the static data + dynamic data combining, you have to do several one to many mappings and reverse mappings. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Capturing Real Time Data | Excel Worksheet Functions | |||
creating dataseries from real time data | Excel Worksheet Functions | |||
storing real time data | Excel Discussion (Misc queries) | |||
Excel 2003's autosum does not update data in real time | Excel Worksheet Functions |