RTD_Disconnect is called before even refreshing

Add-in Express™ Support Service
That's what is more important than anything else

RTD_Disconnect is called before even refreshing
 
Ranjitha Nagendra




Posts: 40
Joined: 2015-10-26
Hello team,

I know I am doing something wrong, but could you please guide me?

I have added an ADXRTDServerModule in my project, I have added the 3 events Connect, RefreshData, And Disconnect event.

In Connect, I subscribe to a server through websocket, In RefreshData, I check if there are any updates from the server, if yes, I display data, else nothing, And then I have Disconnect where I unsubscribe from the server through websocket again.

I add a function to excel , it just works fine. Now I save the workbook and reopen. Here on opening it calls RTD_Connect and then Disconnect. RefreshData is not executed. why is this behaviour? Where I might be going wrong? could you please suggest?
Ranjitha
Posted 20 Oct, 2016 05:49:22 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Ranjitha,

I suppose you experience the issue I described at https://social.msdn.microsoft.com/Forums/vstudio/en-US/556d379f-1195-4daf-b439-6c13b7c9e6a5/rtd-server-doesnt-work-in-excel-2016-scenario-supplied?forum=exceldev. If so, update your Excel (Office) 2016.


Andrei Smolin
Add-in Express Team Leader
Posted 20 Oct, 2016 06:10:19 Top
Ranjitha Nagendra




Posts: 40
Joined: 2015-10-26
Hi Andrei,

I installed the update, I tried the workaround by specifying second argument as "localhost", no luck. Probably I am only doing something silly?
Ranjitha
Posted 20 Oct, 2016 06:50:54 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Ranjitha,

Does the issue occur if your RTD server returns a random value?


Andrei Smolin
Add-in Express Team Leader
Posted 20 Oct, 2016 06:55:47 Top
Ranjitha Nagendra




Posts: 40
Joined: 2015-10-26
Actually In my RefreshData event, I am creating a BackGroundWorker object to get the data and write that data on excel. the data written is a 2-dim array. When I log the actions, i see that RefreshData is not fired at all. First I see Connect event, and then Disconnect. If I manually click on that cell and calculate by pressing entire, then again Connect is called, and then RefreshData which is fine there after.
Ranjitha
Posted 20 Oct, 2016 07:02:50 Top
Ranjitha Nagendra




Posts: 40
Joined: 2015-10-26
Hi Andrei,

I just checked deploying my code on Excel 2013. There also RefreshData is not fired initially on opening a workbook after Connect. Only when I invoke it by clicking on the cell and pressing enter, Connect, RefreshData events are fired.

Regards,
Ranjitha
Ranjitha
Posted 20 Oct, 2016 07:44:47 Top
Ranjitha Nagendra




Posts: 40
Joined: 2015-10-26
Hi Andrei,

Calling workbook.CalculateFull in Workbook.Open event is working.

Regards,
Ranjitha
Ranjitha
Posted 20 Oct, 2016 08:09:15 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Ranjitha,

I cannot reproduce this issue using http://temp.add-in-express.com/support/MyRTDServer9-SimplestExample.zip in Excel 2013-2016.


Andrei Smolin
Add-in Express Team Leader
Posted 20 Oct, 2016 08:49:07 Top
Ranjitha Nagendra




Posts: 40
Joined: 2015-10-26
Hi Andrei,

I don't see adxrtdTopic1_Disconnect being fired when I test with your example? when is that fired?
Ranjitha
Posted 21 Oct, 2016 00:22:36 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Ranjitha,

Delete the RTD formula that invokes your RTD server.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Oct, 2016 05:36:38 Top