Re: [ExcelDna] RTD Server ExcelDNA .30

448 views
Skip to first unread message

Naju Mancheril

unread,
Jan 17, 2013, 5:54:19 PM1/17/13
to exce...@googlegroups.com
(1) Are you compiling from source?

(2) What version of Excel are you using?

I believe there are some old, buggy versions of Excel which reuse topicIds without first disconnecting. [They invoke IRtdServer.ConnectData on the same topicId without first calling IRtdServer.DisconnectData.]

If this is happening, then your options are:

(a) Update your Excel [if the problem is an old version]

(b) Edit the ExcelDna ExcelRtdServer class to force disconnect.

        object IRtdServer.ConnectData(int topicId, ref object[] strings, ref bool newValues)
        {
            // Buggy version of Excel have reused TopicIds without disconnect
            ((IRtdServer)this).DisconnectData(topicId);


           ... leave this code alone ...



        void IRtdServer.DisconnectData(int topicId)
        {
            try
            {
                Topic topic;
                if(!_activeTopics.TryGetValue(topicId, out topic)) {
                  return;
                }


           ... leave this code alone ...

Naju Mancheril

unread,
Jan 17, 2013, 5:57:33 PM1/17/13
to exce...@googlegroups.com
Also, is that System.Timers.Timer?

You might be happier using the System.Threading.Timers.Timer.

Naju Mancheril

unread,
Jan 17, 2013, 6:14:36 PM1/17/13
to exce...@googlegroups.com
Here is a link about the disconnect bug. Govert found it a while back.

http://social.msdn.microsoft.com/Forums/pl/exceldev/thread/ba06ac78-7b64-449b-bce4-9a03ac91f0eb

If you're using Excel 2010, try installing SP1. That may fix it. Then you won't need to edit the code.


Naju Mancheril

unread,
Jan 17, 2013, 6:20:41 PM1/17/13
to exce...@googlegroups.com
Sounds good.

I don't remember whether I encountered this bug in Excel 2007. It may have been a problem there too.

Govert van Drimmelen

unread,
Jan 18, 2013, 2:57:00 PM1/18/13
to Excel-DNA
Hi Chris,

My understanding is that the Excel RTD Disconnect bug was present in
the released version of Excel 2010.
The link pasted earlier (http://social.msdn.microsoft.com/Forums/pl/
exceldev/thread/ba06ac78-7b64-449b-bce4-9a03ac91f0eb) is all I know
about this.
Naju's workaround might help to contain the issue somewhat, as long as
you don't depend on the Disconnect.

ExcelRtdServer is means to be thread-safe, so it shouldn't matter
which timer you use.

If you can find more information about this bug, in particular how we
can know whether a particular Excel instance is affected or not, I'd
love to know. I don't know of problems with my version 14.0.6129.5000
and I don't have the resources to test many different Excel versions
myself.

Regards,
Govert


On Jan 18, 1:09 am, Chris Racioppo <gravedigger7...@gmail.com> wrote:
> 1) I am not compiling from source.
> 2) I am using Excel 2010 Version: 14.0.4760.1000
> 2a) I can't really update excel because this is going to be used on users
> machine who can have any version from 2007 and up
> 2b) I'll give that a shot tomorrow and compile from source and see what
> happens!
>
> Also I am indeed using System.Timers.Timer, I'll switch it over!
>
> Thanks for the help! I'll keep you posted
>
>
>
>
>
>
>
> On Thursday, January 17, 2013 5:54:19 PM UTC-5, ngm wrote:
>
> > (1) Are you compiling from source?
>
> > (2) What version of Excel are you using?
>
> > I believe there are some old, buggy versions of Excel which reuse topicIds
> > without first disconnecting. [They invoke IRtdServer.ConnectData on the
> > same topicId without first calling IRtdServer.DisconnectData.]
>
> > If this is happening, then your options are:
>
> > (a) Update your Excel [if the problem is an old version]
>
> > (b) Edit the ExcelDna ExcelRtdServer class to force disconnect.
>
> >         object IRtdServer.ConnectData(int topicId, ref object[] strings,
> > ref bool newValues)
> >         {
> > *            // Buggy version of Excel have reused TopicIds without
> > disconnect
> >             ((IRtdServer)this).DisconnectData(topicId);*
>
> >            ... leave this code alone ...
>
> >         void IRtdServer.DisconnectData(int topicId)
> >         {
> >             try
> >             {
> > *                Topic topic;
> >                 if(!_activeTopics.TryGetValue(topicId, out topic)) {
> >                   return;
> >                 }*
Reply all
Reply to author
Forward
0 new messages