-
-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RTD bug in Excel beta and preview versions of 2409 #715
Comments
Addition -
|
Microsoft has acknowledged the bug:
|
Further feedback from Microsoft:
|
Without an update, the RTD problem is no longer present in the Beta or Preview versions I was testing with. The Current version has been updated to 2409 and does not exhibit the problem either (even though it is not at the version indicated for a fix yet). It seems like the changes were reverted by an over-the-air feature flag change. |
I have found a bug in the RTD-based features in the beta (as of 2024-08-30) versions of Excel version 2409.
RTD overview
Excel-DNA (and other add-in frameworks like PyXLL, JINX, XLL+, xlOil ), provides an RTD server base class implementation (called
ExcelRtdServer
), and then RTD-based implementations of async and streaming (IObservable) functions implemented with the same infrastructure.There is a detailed description of the RTD mechanism with links to Microsoft source material in the Excel-DNA RTD Tutorial.
Affected Excel versions
In the current Beta channel version of Excel, there is a bug that in many cases prevents these features from updating correctly. This also affects RTD servers directly implemented in COM without Excel-DNA, and below we discuss reproducing the bug with a simple RTD server implemented in C#.
I've confirmed the problem with these versions:
The last version I tested which had no problems was version 2408 (which was in the CurrentPreview channel as of 2024-09-01). So this version was fine:
Instruction for changing the update channel are here:
Change the Microsoft 365 Apps update channel for devices in your organization - Microsoft 365 Apps | Microsoft Learn
Reverting to an exact earlier versions of Office can be done according to these instructions
Bug details
The RTD call contract indicates that a call to
IRTDUpdateEvent.UpdateNotify()
(or multiple such calls) must always be followed by a later callback from Excel to theIRtdServer.RefreshData(...)
method.With the affected Excel versions, an RTD server may call
UpdateNotify
, and not receive any subsequentRefreshData
callback. In particular, there is an interaction between the interval betweenUpdateNotify
calls and the RTD ThrottleInterval. When tracing the calls, the pattern might look like this:In this case the interval between UpdateNotify calls was 1 second, which is smaller than the RTD ThrottleInterval setting in this run, which was the default value of 2 seconds (2000).
(Note that for the sample RTD Server,
UpdateNotify
calls are made regularly, but for many RTD ServersUpdateNotify
will only be called when new data arrives, with varying intervals.)It seems if
UpdateNotify
calls are made in a period shorter than theThrottleInterval
, Excel will never subsequently callRefreshData
. This violates the RTD call 'contract' and is a change of behavior from earlier Excel versions.Test and reproduction instructions
The bug can be reproduced using the simple C#-based RTD server described here: https://weblogs.asp.net/kennykerr/Rtd6
The code from this blog writeup is available as a GitHub repository here: https://github.com/govert/KennyKerrRTD
(Note that the RTD Server must be 'Registered for COM Interop' and hence Visual Studio must run 'As Administrator' to rebuild the project.)
After building the project, the RTD server can be tested in Excel by calling from a workbook:
With the unchanged RTD server project and default Excel RTD ThrottleInterval, updates work correctly.
To reproduce the bug we can either change the RTD server update interval to 1000 (from 2000ms) or change the Excel RTD ThrottleInterval to 3000 (to make it larger than the RTD server update interval. After this change, the updates will halt after the first refresh.
Impact
Excel-DNA add-ins using the RTD-based features (for streaming values or async functions) call
UpdateNotify
at irregular times. The Excel-DNA implementation takes care to only callUpdateNotify
when needed (the first time there is an update after the lastRefreshData
call) and will suppress additional update calls. This means under versions with the bug, updates may also work for a while, and then stop unexpectedly.The text was updated successfully, but these errors were encountered: