Excel-DNA / ExcelDna

Excel-DNA - Free and easy .NET for Excel. This repository contains the core Excel-DNA library.
https://excel-dna.net
zlib License
1.31k stars 277 forks source link

Rtd server terminated by Excel #724

Open tomap opened 1 month ago

tomap commented 1 month ago

Hello,

I seem to have stumbled upon this issue: https://github.com/Excel-DNA/ExcelDna/blob/master/Source/ExcelDna.Integration/ExcelRtdServer.cs#L394

=> my RTD server is stopping

The setup on this Excel (2016, 32 bits) has other ExcelDna plugins, and when the spreadsheet is launched, there are some heavy computations that freeze Excel for some period (maybe up to 30 sec)

I tried to increase the HeartbeatInterval from 15sec to 60sec The issue seem to be gone, but I'm not sure if this solved the issue I'm not sure if I'm targeting the right cause

Also, when enabling ExcelDna logs, I found multiple occurences of: [WRN] Heartbeat callback while Notified in RTD server MyRtdServer - retrying UpdateNotify ExcelDna.Integration

Not sure what it means.

Any help is appreciated

(BTW: I'm still using ExcelDna 1.6 + .Net Framework)

tomap commented 1 month ago

Plugin updated to ExcelDna 1.8 Still with a similar issue It seems now the rtd server is not terminated (at least the terminate is not called) however, some rtd topics are disconnected

Would adding a comvisible() help? https://github.com/Excel-DNA/Samples/blob/master/RtdClocks/RtdClock-ExcelRtdServer/RtdClockServer.cs#L9 Or is it just an old example?

govert commented 1 month ago

Are you able to make an example that reproduces this, that I can try?

tomap commented 1 month ago

hum, probably not, but I'll try... I believe some other excel plugins (refinitiv & some home made) might be the cause because one case I have is when another plugin is loaded into Excel

govert commented 1 month ago

I wonder how they might be interfering . . . it's not obvious how another add-in could cause that behaviour in your RTD server.

There have been some very isolated and occasional reports of RTD updates getting 'stuck' (and there was a related Excel bug in a recent beta, now fixed). But you're taking about topics getting disconnected unexpectedly. I've not heard of that. The only normal case would be if you have a UDF wrapper that sometimes fails to call the RTD topic when the cell is updated. That will disconnect the topic (by design).

I'd be very keen to help find any RTD bugs, but I'm not sure where to start. Can you reproduce the disconnect easily, or are these isolated problem reports?