Вы находитесь на странице: 1из 10

Developer Network

Sign in Subscriber portal Get tools

Downloads Programs Community Documentation

Ask a question Search related threads Search forum questions

Quick access

Answered by: Excel 2010 and RTD Bug?


Microsoft Office for Developers > Excel for Developers

7,375 Question
Points
Top 1%
I have recently started using the RTD server feature of Excel. My development process started in Excel 2007.
During the project I upgraded to Excel 2010. I am now experiencing some unexpected behaviour from Excel
Bessie Zhao 2010 which does not occur in 2007. Issue is as follows:
Joined Jun 2009

Bessie Zhao's thre… 2 RTD server developed and deployed, using the example at http://msdn.microsoft.com/en-
us/library/aa140061(office.10).aspx to illustrate my issue.
1 5 11 Show activity Sign in
to Enter a formula in Excel as follows: =RTD("Stock.Quote", , "MSFT", "Open")
vote Value resolves and all is good.
Change the formula to: =RTD("Stock.Quote", , "MSFT1", "Open")
I get a disconnect in my RTD server of the old topic and a connect for the new one. All good.
Now I start a new test from scratch and enter the formula as follows: =RTD("Stock.Quote", , A2,
"Open")
A2 contains MFST.
I change A2 to MFST1.
I get a connect for MFST1 but no disconnect for MFST
I change A2 back to MFST.
Again no disconnect MFST1 and no connect for MFST.
The issue seems to be that if the parameters of the formula are edited in the cell, it behaves as
expected. However if the formula refers to another cell, and that cell is edited, it does not behave as
expected.
I have tested this in Excel 2007 and here I always get the disconnect whether the formula’s parameters are
edited in the formula itself or if they are referring to another cell and that cell value is changed.

I can’t imagine that this can be the desired functionality so it surely cannot be an intended change in the way
Excel 2010 interacts with RTD? So is this a known bug with Excel 2010?

Thanks

Tuesday, August 3, 2010 1:48 PM

Reply | Quote
Shaun Pendrigh 30 Points

Answers
Hello,

I have reported a feedback into office bug database, which is an appropriate channel. However this link is
an internal one. This issue will be routed to the product unit who works on this special feature area for
1 triage and resolution. I will follow up as long as there is any feedback on this case. It may be some time
Sign in before we get response from product unit. Please be patient.
to
vote Best regards,
Bessie Zhao - MSFT
MSDN Subscriber Support in Forum
If you have any feedback of our support, please contact msdnmg@microsoft.com

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Marked as answer by Bessie Zhao Tuesday, August 10, 2010 10:13 AM


Edited by Bessie Zhao Monday, August 23, 2010 4:57 AM

Monday, August 9, 2010 7:33 AM

Reply | Quote
Bessie Zhao 7,375 Points

All replies

Hello Shaun,

Thanks for posting. Actually, I am not very familiar with Excel RTD Server. However, I think I may reproduce
this issue in my side. For this, would you please share the simple project developed in Excel 2007 with us?
0 So that I could used in my side.
Sign in
to We are looking forward to your response.
vote
Best regards,
Bessie Zhao - MSFT
MSDN Subscriber Support in Forum
If you have any feedback of our support, please contact msdnmg@microsoft.com.

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Wednesday, August 4, 2010 8:28 AM

Reply | Quote
Bessie Zhao 7,375 Points

Hi

Thanks for the reply. Here is my code for the RTD server. As mentioned it was created from the example on
MSDN. I don't see a way to add an attachement to the forum so let me know if I should email the whole
0 visual studio project. It is VS2010. Thanks
Sign in
to Imports Microsoft.Office.Interop.Excel '<-- Excel's object library.
vote Imports System.Timers '<-- For our timers.
Imports System.Runtime.InteropServices '<-- For our interop attributes.
Imports System.Collections '<-- For our collections of quotes.

<ComVisible(True), ProgId("Stock.Quote")> _
Public Class StockQuote
Implements IRtdServer

Private m_xlRTDUpdate As IRTDUpdateEvent


Private WithEvents m_tmrTimer As Timer
Private m_colRTDData As Collection = New Collection()

'Default constructor with no arguments.


'Required for COM interop.
Public Sub New()
()

End Sub

Private Sub m_tmrTimer_Elapsed(ByVal sender As Object, _


ByVal e As ElapsedEventArgs) Handles m_tmrTimer.Elapsed
Dim objData As RTDData
'Create a shared randomizer.
Dim rdmRandomizer As Random = New Random()
'Call update for each stock quote.
For Each objData In m_colRTDData
objData.Update(rdmRandomizer)
Next
'Tell Excel that we have updates.
m_xlRTDUpdate.UpdateNotify()
End Sub

Public Function ConnectData(ByVal TopicID As Integer, _


ByRef Strings As System.Array, _
ByRef GetNewValues As Boolean) As Object _
Implements IRtdServer.ConnectData
Dim strValue, strTicker As String
Dim objRTDData As RTDData

'Make sure that the timer is started.


If Not m_tmrTimer.Enabled Then
m_tmrTimer.Start()
End If
GetNewValues = True
Try
strTicker = UCase(Strings(0)) 'First argument is the ticker.
strValue = LCase(Strings(1)) 'Second argument is the type.

'Check the value and act appropriately.


If strValue = "last" Then
'They want the last value.
'Check if the data object was created.
Try
objRTDData = m_colRTDData.Item(strTicker)
Catch
'Item wasn't found – create.
objRTDData = New RTDData(strTicker)
'Add to collection.
m_colRTDData.Add(objRTDData, strTicker)
End Try
If objRTDData.TopicID = -1 Then
'We want this one's topic ID for later updates.
objRTDData.TopicID = TopicID
End If
Return CObj(objRTDData.Last)
ElseIf strValue = "open" Then
'They want the opening price.
'Check if the data object was created.
Try
objRTDData = m_colRTDData.Item(strTicker)
Catch
'Item wasn't found – create.
objRTDData = New RTDData(strTicker)
'Add to collection.
m_colRTDData.Add(objRTDData, strTicker)
End Try
Return CObj(objRTDData.Open)
Else
'Unrecognized value requested.
'Tell the user.
Return "Unrecognized value requested"
End If
Catch
'Any unexpected error.
Return "ERROR IN QUOTE"
End Try
End Function

Public Sub DisconnectData(ByVal TopicID As Integer) _


Implements IRtdServer.DisconnectData

Debug.Print("Disconnect")
'User no longer wants the quote.
'Loop over the quotes and try to find it.
Dim objRTDData As RTDData
For Each objRTDData In m_colRTDData
If objRTDData.TopicID = TopicID Then
'Found it ... remove it.
m_colRTDData.Remove(objRTDData.Ticker)
End If
Next
'Stop the timer if we are done.
If m_colRTDData.Count = 0 And m_tmrTimer.Enabled Then
m_tmrTimer.Stop()
End If
End Sub
Public Function Heartbeat() As Integer _
Implements IRtdServer.Heartbeat
Return 1
End Function

Public Function RefreshData(ByRef TopicCount As Integer) _


As System.Array Implements IRtdServer.RefreshData
Dim intItemCount As Integer
Dim aRetVal(1, m_colRTDData.Count - 1) As Object
Dim i As Integer
For i = 1 To m_colRTDData.Count
Dim curItem As RTDData = m_colRTDData.Item(i)
If curItem.TopicID <> -1 Then
'Update the topic with the latest value.
aRetVal(0, i - 1) = curItem.TopicID
aRetVal(1, i - 1) = curItem.Last
intItemCount += 1
End If
Next
'Tell Excel how many topics we updated.
TopicCount = intItemCount
'Return the updates.
Return aRetVal
End Function

Public Function ServerStart(ByVal CallbackObject As IRTDUpdateEvent) _


As Integer Implements IRtdServer.ServerStart
'Hold a reference to the callback object.
m_xlRTDUpdate = CallbackObject
'Create the time with a 2000 millisecond interval.
m_tmrTimer = New Timer(2000)
m_tmrTimer.AutoReset = True
'All is well, return 1.
Return 1
End Function

Public Sub ServerTerminate() Implements IRtdServer.ServerTerminate


'Clear the RTDUpdateEvent reference.
m_xlRTDUpdate = Nothing
'Make sure the timer is stopped.
If m_tmrTimer.Enabled Then
m tmrTimer Stop()
m_tmrTimer.Stop()
End If
m_tmrTimer = Nothing
End Sub

Private Class RTDData


'Private variables for the properties.
Private m_strTicker As String
Private m_sngLast, m_sngOpen As Single
Private m_intTopicID As Integer = -1

'Constructor.
Public Sub New(ByVal NewTicker As String)
Dim rdm As Random = New Random()
'Set ticker and topic ID.
m_strTicker = NewTicker
'Use a random number for the opening price.
m_sngOpen = rdm.NextDouble() * 100
'Set the last price to the opening price.
m_sngLast = m_sngOpen
End Sub

Public ReadOnly Property Ticker() As String


Get
Return m_strTicker
End Get
End Property

Public ReadOnly Property Last() As Single


Get
Return m_sngLast
End Get
End Property

Public ReadOnly Property Open() As Single


Get
Return m_sngOpen
End Get
End Property

Public Property TopicID() As Integer


Get
Return m_intTopicID
End Get
Set(ByVal Value As Integer)
m_intTopicID = Value
End Set
End Property

Public Sub Update(ByVal rdm As Random)


'Get the price change.
Dim sngPriceChange = rdm.NextDouble() * 5
If rdm.Next(1, 10) < 5 Then
'Drop in price.
m_sngLast -= sngPriceChange
Else
'Increase in price.
m_sngLast += sngPriceChange
End If
End Sub
End Class
End Class

Thursday, August 5, 2010 7:20 AM

Reply | Quote
Shaun Pendrigh 30 Points
Hello Shaun,

Please upload this sample via http://skydrive.live.com. I am looking forward to your response. :)

Best regards,
0 Bessie Zhao - MSFT
Sign in
to MSDN Subscriber Support in Forum
vote If you have any feedback of our support, please contact msdnmg@microsoft.com

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Thursday, August 5, 2010 8:16 AM

Reply | Quote
Bessie Zhao 7,375 Points

Hi

I have uploaded it. But how do I share it with you as I do not have your email?

Thanks
0
Sign in
to
vote Thursday, August 5, 2010 9:54 AM

Reply | Quote
Shaun Pendrigh 30 Points

After uploding the sample project, you could open this it online. Please paste the link here. Then I could
access this sample in my side. You also could send the project to v-beszha@microsoft.com.

Best regards,
0 Bessie Zhao - MSFT
Sign in MSDN Subscriber Support in Forum
to If you have any feedback of our support, please contact msdnmg@microsoft.com
vote

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Thursday, August 5, 2010 10:47 AM

Reply | Quote
Bessie Zhao 7,375 Points

Ok, let me know if this works - http://cid-e8beeb5a84452b04.office.live.com/self.aspx/.Public/NetRTD.zip

Thanks

0
Sign in Thursday, August 5, 2010 11:01 AM
to
vote Reply | Quote
Shaun Pendrigh 30 Points
Hello Shaun,

Thanks for this link. Now I could use the code in my side, and reproduce a similar scenario. Now, I am able
to ensure that the behaviors in Excel 2007 and Excel 2010 are different by using this code.
0 The same thing is that the value of cell with this RTD formula is changed as expected in Excel 2007 and
Sign in
to 2010. As I test in Excel 2010, when the value in A2 has been used before, and input this value again into
vote cell A2, it will not call ConnectData and Disconnect method. However, in Excel 2007, it will call these two
methods every time the value in cell A2 is changed.

To narrow down this issue, I think you could put the code into try and catch block, set breakpoint to this
code, and see if there is an exception. It might be related to an exception. You also could try to create an
very simple RTD to see if this behavior also happens. If not, I am thinking if there are some changes since
Excel 2010. Unfortunately, there is no an official documentation for this point. I will keep on
researching this topic. I will follow up as long as there are some information I could share with you.

Best regards,
Bessie Zhao - MSFT
MSDN Subscriber Support in Forum
If you have any feedback of our support, please contact msdnmg@microsoft.com

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Friday, August 6, 2010 6:39 AM

Reply | Quote
Bessie Zhao 7,375 Points

Thanks so much for taking the time to research this. I have tried many things to work out if it is my code that causes the problem. And I am
confident that it is not and there are no exceptions. Also, the fact that Excel 2010 is inconsistent in its behaviour depending on whether you
edit the formula directly or edit a cell linked to the formula makes me certain that this cannot be a change in the intended behaviour.

0 I am therefore concluding that this must be a bug. And it is a big concern for me as the customers of my product will have inconsistent

Sign in results if they run my product on Excel 2010 with it behaving as it does. I urgently need to get the bug logged with Microsoft so that a fix can
to be issued. How do I do this?
vote
Thanks

Friday, August 6, 2010 10:50 AM

Reply | Quote
Shaun Pendrigh 30 Points

We could report a feedback through Visual Studio & .NET Connect site:
http://connect.microsoft.com/visualstudio. This issue will be routed to the product unit who works on this
specific feature area for triage and resolution.

0 Best regards,
Sign in Bessie Zhao - MSFT
to MSDN Subscriber Support in Forum
vote
If you have any feedback of our support, please contact msdnmg@microsoft.com

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Friday, August 6, 2010 10:57 AM

Reply | Quote
Bessie Zhao 7,375 Points
Thanks, but should we not submit this to the Excel developers rather than Visual Studio? I am sure the
problem is on the Excel side?

Friday, August 6, 2010 11:02 AM


0
Sign in Reply | Quote
Shaun Pendrigh 30 Points
to
vote

As far as I know, the only way to report feedback is via Visual Studio & .NET Connect site. For this specific
issue, I will talk to my colleague next Monday, and see if there is any other channel to report this issue.
During this weekend, I am afraid that I am not able to follow up here. However, I am sure that I will follow
up as soon as possible.
0
Sign in Have a nice weekend.
to
vote Best regards,
Bessie Zhao - MSFT
MSDN Subscriber Support in Forum
If you have any feedback of our support, please contact msdnmg@microsoft.com

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Friday, August 6, 2010 11:13 AM

Reply | Quote
Bessie Zhao 7,375 Points

Hi Bessie

I had a look at the connect site and I see that there are limited products that you can log bugs for.

0 I have not logged this issue against Visual Studio yet as I am concerned that I am just going to make somebody angry by logging an Excel
problem as a Visual Studio bug. I will wait to hear back from you next week and hopefully find a way to log this with Excel support.
Sign in
to
vote Thanks again for your help!

Friday, August 6, 2010 1:53 PM

Reply | Quote
Shaun Pendrigh 30 Points

Hello,

I have reported a feedback into office bug database, which is an appropriate channel. However this link is
an internal one. This issue will be routed to the product unit who works on this special feature area for
1 triage and resolution. I will follow up as long as there is any feedback on this case. It may be some time
Sign in before we get response from product unit. Please be patient.
to
vote Best regards,
Bessie Zhao - MSFT
MSDN Subscriber Support in Forum
If you have any feedback of our support, please contact msdnmg@microsoft.com

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Marked as answer by Bessie Zhao Tuesday, August 10, 2010 10:13 AM


Edited by Bessie Zhao Monday, August 23, 2010 4:57 AM

Monday, August 9, 2010 7:33 AM

Reply | Quote
Bessie Zhao 7,375 Points
Thanks you so much Bessie. I appreciate all your help with this.

Monday, August 9, 2010 7:39 AM

0 Reply | Quote
Shaun Pendrigh 30 Points
Sign in
to
vote

Hi Bessie

Just checking if there has been any movement on the Office bug?
0
Sign in  
to
vote
Thanks

Friday, October 1, 2010 5:11 AM

Reply | Quote
Shaun Pendrigh 30 Points

Hello Shaun,

This issue has been confirmed as a bug. And it also has been ported to the Office14 database for further
investigation and tracking. Sorry, I am not a member of product team. They may fix it in future version. However, I
0 am not sure about this point. Thanks for your understanding and have a nice day.

Sign in
to Best regards,
vote Bessie Zhao - MSFT
MSDN Subscriber Support in Forum
If you have any feedback of our support, please contact msdnmg@microsoft.com

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Thursday, October 7, 2010 4:50 AM

Reply | Quote
Bessie Zhao 7,375 Points

I have noticed this same issue as well and I am hesitant to begin using Excel 2010 until it is resolved.  Do
you have any further information on the status of this bug from the product unit?  Will there be an Office
2010 update/patch released within the next couple of months?  Ideally, I'd like to start using Excel 2010
with RTD next year (2011).
1
Sign in Thanks
to
vote -Keith

Monday, November 8, 2010 1:31 PM

Reply | Quote
Keith Caswell 5 Points
Hi Keith

There is a hotfix out and an update due (not exactly sure when). You can see the detail here -
http://support.microsoft.com/kb/2405840
1 Regards
Sign in
to
vote  

Proposed as answer by Govert van Drimmelen Monday, November 8, 2010 2:32 PM

Monday, November 8, 2010 1:39 PM

Reply | Quote
Shaun Pendrigh 30 Points

Can someone confirm if KB2405840 will be included into upcoming Office 2010 SP1? Is there any official
list of fixes included into SP1?

Monday, January 10, 2011 2:23 PM


1
Sign in Reply | Quote
Oleg Makovski 5 Points
to
vote

Help us improve MSDN. Make a suggestion

Dev centers Learning resources Community Support


Microsoft Virtual Academy Forums Self support
Windows
Channel 9 Blogs

Office MSDN Magazine Codeplex

Visual Studio
Programs
Microsoft Azure BizSpark (for startups)
Microsoft Imagine (for students)
More...

United States (English) Newsletter Privacy & cookies Terms of use Trademarks © 2019 Microsoft