A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Programming
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

RTD server : Updatenotify does not return and Excel not calling refreshData method



 
 
Thread Tools Display Modes
  #1  
Old July 10th 12, 12:07 PM
kamesh kamesh is offline
Junior Member
 
First recorded activity by ExcelBanter: Jul 2012
Posts: 2
Default RTD server : Updatenotify does not return and Excel not calling refreshData method

Hi,
I have implemented an RTD server in c#
Its working fine in 2003 but when I use excel 2007 the cell values stop updating after while.

Here is my logic for refreshdata and update notify

I have used alreadyNotified flag to make sure that there are no excessive updatenotify calls which might make excel unresponsive

public System.Array RefreshData(ref int TopicCount){
Console.WriteLine("entering RefreshData " + Thread.CurrentContext.ContextID);

alreadyNotified = false;

// Logic to update the excel sheet cells

Console.WriteLine("already notified set to FALSE");
Console.WriteLine("exiting refresh data " + Thread.CurrentContext.ContextID);
return obs;
}




// This is called when we receive new values

private void notifyExcel(){

Console.WriteLine(" ------- ENTERING NOTIFY EXCEL -----------");
Console.WriteLine("already notified flag is : " + alreadyNotified);
if (m_xlRTDUpdate != null && !alreadyNotified)
{
alreadyNotified = true;
Console.WriteLine("already notified set to TRUE");
Console.WriteLine("before update notify");
m_xlRTDUpdate.UpdateNotify();
Console.WriteLine("after update notify");
}
Console.WriteLine(" ******** EXITING NOTIFY EXCEL *************");
}


when I have debugged it for a while, the values stopped streaming and my logs showed the following:


09/07/2012 19:16:47 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:47 already notified flag is : False
09/07/2012 19:16:47 already notified set to TRUE
09/07/2012 19:16:47 before update notify
09/07/2012 19:16:47 after update notify
09/07/2012 19:16:47 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:47 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:47 already notified flag is : True
09/07/2012 19:16:47 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:47 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:47 already notified flag is : True
09/07/2012 19:16:47 already notified set to TRUE
09/07/2012 19:16:47 before update notify
09/07/2012 19:16:47 exiting refresh data 0
09/07/2012 19:16:48 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:48 already notified flag is : True
09/07/2012 19:16:48 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:48 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:48 already notified flag is : True
09/07/2012 19:16:48 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:48 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:48 already notified flag is : True
09/07/2012 19:16:48 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:48 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:48 already notified flag is : True
09/07/2012 19:16:48 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:48 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:48 already notified flag is : True
09/07/2012 19:16:48 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:48 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:48 already notified flag is : True
09/07/2012 19:16:48 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:49 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:49 already notified flag is : True

The logs show that last update notity method does not return at all

I am not sure how do it solve this problem and this is happening every time

Can some one please point me in right direction in solving this


Thanks,
kams..
Ads
  #2  
Old July 11th 12, 12:29 AM posted to microsoft.public.excel.programming
Auric__
external usenet poster
 
Posts: 304
Default RTD server : Updatenotify does not return and Excel not calling refreshData method

kamesh wrote:

> I have implemented an RTD server in c#
> Its working fine in 2003 but when I use excel 2007 the cell values stop
> updating after while.
>
> Here is my logic for refreshdata and update notify
>
> I have used alreadyNotified flag to make sure that there are no
> excessive updatenotify calls which might make excel unresponsive

[snip]
> The logs show that last update notity method does not return at all
>
> I am not sure how do it solve this problem and this is happening every
> time
>
> Can some one please point me in right direction in solving this


I'd suggest asking in the group comp.os.ms-windows.programmer.win32.

--
If voting changed anything, they'd make it illegal.
  #3  
Old July 19th 12, 01:10 PM
kamesh kamesh is offline
Junior Member
 
First recorded activity by ExcelBanter: Jul 2012
Posts: 2
Default

Thanks
I have found the problem, excel 2007 throws an exception when ever it is busy and not ready to handle the request.

Solved the issue by catching the exception and added a timer to notify again
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel creates massive files on calling vba workbook.save method Tom Med Excel Programming 1 September 26th 07 07:05 PM
Calling Excel/Opentext method via ActiveX in a service application Salar Madadi Excel Programming 1 January 30th 06 11:33 PM
GetObject method from excel to other application from remote server sandra mangunsong via OfficeKB.com Excel Programming 1 February 24th 05 07:13 PM
RefreshData Method in RTD Server kitty Excel Programming 1 April 14th 04 10:43 PM
calling a stored procedure on MS SQL Server within MS Excel 2000 Witold Domienik Excel Programming 0 March 2nd 04 10:47 AM


All times are GMT +1. The time now is 10:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2004-2013 ExcelBanter.
The comments are property of their posters.