[ExcelFunction(Name = "GetData", Category = "M", IsVolatile = false, IsMacroType = true, Description = "Get live data")]
public static object[,] GetData([ExcelArgument(AllowReference = false, Name = "Instrument", Description = "Instrument")]string product,
[ExcelArgument(AllowReference = false, Name = "Strip", Description = "Strip or strips to synchronize (optional)")]object strip)
{object result = XlCall.Excel(XlCall.xlfRtd, DataRTDProgId, null, product, strip);return new object[,] { { result }};And we have standard RTD server registered by:ComServer.DllRegisterServer(); call dynamically at AutoOpen.The RTD server received DisconnectData for all of it's subscription in this case from excel/exceldna.If you would have any suggestion which way we we should start that would be great.Tamas
Hi Tamas,
From your code I see you are making the RTD calls directly, via the xlfRtd function and using ComServer.DllRegisterServer() to register the RTD COM server.
I presume you’ve made the RTD server by implementing IRtdServer yourself.
If so, you have to be really careful with the RefreshData callbacks to Excel. They have to always run on the main Excel thread. In addition, and unhandled exceptions you have in any of the IRtdServer functions would be a problem to Excel (though I’d expect Excel to crash in these cases.)
I’d then recommend you try to move the RTD server to using the ExcelRtdServer base class in Excel-DNA. That’s more careful with the updates back to Excel.
If you’re not using the RTD server from the sheet directly with =RTD(…) functions, you might also simplify things by calling via the Excel-DNA just-in-time registration. For this you replace XlCall.Excel(XlCall.xlfRtd, …) with XlCall.RTD(…).
Then you can get rid of the persistent ComServer.DllRegisterServer() call.
Otherwise, I can’t think of users users having reported similar problems, so I expect it to be related your RTD server implementation. But I don’t know whether other users are using it in long-running setting, though I’d guess there were some.
-Govert
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at http://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.