Hi Peter,
1. What version(s) of Excel are you seeing this with? It's worthwhile
to make sure that your Office is up-to-date with service packs and
updates - Excel has had some RTD-related bugs in the past, though
nothing I can recall that matches your description.
2. You should not expect a call to RefreshData for every call to
UpdateNotify. But after a one or more calls to UpdateNotify, you
should get at least one call to RefreshData. You should be careful in
how you keep track of your internal record of changes values, so that
all of them can be reported to the next RefreshData call.
3. I'm surprised that Excel would recalculate your formula if it
hasn't called RefreshData. I'd expect it only to recalculate cells
that are associated with topics mentioned in your RefreshData.
4. I'd certainly recommend implementing in terms of the Excel-DNA
ExcelRtdServer base class. It tries to be careful with the threading
and gives you a simplified programming model - just call the
Topic.SetValue(...) from any thread. But that doesn't explain the
problem you report. If you've tried this it should take care of the
UpdateNotify callback and the coordination in issue 2. above.
5. I can't see how some registry corruption could be an issue. As far
as I know, the registry is only involved in:
(a) Starting the RTD server.
(b) Keeping track of the ThrottleInterval settings.
6. Certainly window message hooking or the like could interfere. I
know of no issues related to what Excel-DNA does, and there are quite
a few RTD users that have not reported anything similar. Recent (post
v.0.30) versions of Excel-DNA have added a workaround to an Excel 2010
RTD bug that is pretty complicated. It will only be active if you are
using the latest Excel-DNA from CodePlex, and your RTD server is based
on ExcelRtdServer, and Excel 2010 without SP1 or the KB2405840 patch.
But even that should not interfere with the UpdateNotify / RefreshData
sequence.
I'd suggest the following:
* Ensure the Excel service packs and patches are up-to-date.
* Convert your RTD server to one based on ExcelRtdServer.
* Try to make a simplified version that still exhibits the problem.
Most likely it has to do with the UpdateNotify / RefreshData
coordination.
Regards,
Govert
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
Ensure that the Excel-DNA project continues by
making your donation -
http://excel-dna.net/support/
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
On May 9, 7:21 am, Peter Davies <
excelmailingl...@gmail.com> wrote:
> Hi,
> I'm having issues with some of my RTD servers returning stale values for
> sometimes minutes at a time and am wondering if anyone has suggestions
> about what the cause might be.
> I'm unable to reproduce the issue on demand on my PC, but several users
> encounter it frequently, using similiar spec software and hardware.
> An outline of the problem is as follows:
> - I have an RTD server with a background activity that produces new data
> typically every 2 seconds
> - From my logs I can see the background activity completing successfully
> and UpdateNotify being called on a System.Windows.Forms.Timer thread
> - From my logs I can see that the formula containg the RTD formula
> recalculates, but the value it returns is unchanged
> - The RefreshData method on my RTD server class is not called
>
> (N.B. I also tried changing my code to inherit from ExcelRtdServer rather
> than implement IRtdServer, but it didn't seem to help).
>
> This happens intermittently. From what I can tell it doesn't seem to be
> CPU- or IO-related. I'm wondering if maybe there could be some registry
> corruption issues or window message hooking going on that might be causing
> my problem. Any suggestions gratefully received.
>
> Thanks and regards,
> Peter