Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default RTD Bug? or perhaps a feature?

I have implemented a wonderful RTD Server in c# that works like a dream.

However, After you open Excel, enter the RTD formula (You then get the
MSCoree.dll contains macros prompt - to which you answer yes) and get a
result. If you then close the workbook, so that Excel has no book open, and
then start a new workbook and type the same formula in you just get #N/A ???

I cannot for the life of me work out why. The only way to get the RTD
formulae working again is to close Excel and open it again.

Any Ideas anyone??
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default RTD Bug? or perhaps a feature?

How exactly are you attaching to your DLL file? It sounds as if you are
losing the link so it would be good to know how you are attaching in the
first place.

"Another frustrated developer" wrote:

I have implemented a wonderful RTD Server in c# that works like a dream.

However, After you open Excel, enter the RTD formula (You then get the
MSCoree.dll contains macros prompt - to which you answer yes) and get a
result. If you then close the workbook, so that Excel has no book open, and
then start a new workbook and type the same formula in you just get #N/A ???

I cannot for the life of me work out why. The only way to get the RTD
formulae working again is to close Excel and open it again.

Any Ideas anyone??

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default RTD Bug? or perhaps a feature?

The c# DLL is registered locally with COM interop and is then instantiated
through the following Excel Formula :

=RTD("Pioneer.RTD",,"LongName",1)

Pioneer.RTD being the namespace.classname and LongName being the requred
function and 1 being the parameter.

I have investigated further and the "odd" behaviour occurs anytime that
excel moves out of a state where it has a workbook open that references (or
has referenced) the RTD dll, into a state where it has no workbook open that
has used the RTD dll. ie. you do not need to go into a "no workbooks open"
state to emulate this.

This is odd.

"Jim Thomlinson" wrote:

How exactly are you attaching to your DLL file? It sounds as if you are
losing the link so it would be good to know how you are attaching in the
first place.

"Another frustrated developer" wrote:

I have implemented a wonderful RTD Server in c# that works like a dream.

However, After you open Excel, enter the RTD formula (You then get the
MSCoree.dll contains macros prompt - to which you answer yes) and get a
result. If you then close the workbook, so that Excel has no book open, and
then start a new workbook and type the same formula in you just get #N/A ???

I cannot for the life of me work out why. The only way to get the RTD
formulae working again is to close Excel and open it again.

Any Ideas anyone??

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default RTD Bug? or perhaps a feature?

Jim, worry not, my error.

My RTD uses Remoting to pass groups of queries back to the server. A little
bit of debugging and I've realised that the constructor was bombing second
time through when it tried to configure the remoting channel.

Thanks anyway.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default RTD Bug? or perhaps a feature?

Interesting....

It seems that Excel, although calling Server Terminate on the original DLL,
never lets go of it's reference to it, even after all workbooks are closed.

If a new Workbook is created it instantiates a new instance of the DLL and
places it's calls to this, when this workbook is closed it calls Server
Terminate and stops referencing the DLL (I can see the destructor being
called). But the original DLL reference lives on.

The only time it lets go is when the Excel Application is closed.

The reason this matters is that my local RTD server dll uses remoting to
call to the server and get it's data. In the RTD dll constructor I set up
the remoting configuration. If a second RTD dll object then tries to set up
the same configuration a RemotingException is thrown. I can catch this, and
just assume remoting is set up already, but if the original class ever gets
disposed of then the second will not be able to create remote calls.







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default RTD Bug? or perhaps a feature?

"Another frustrated developer"
. com wrote in message
...
Interesting....

It seems that Excel, although calling Server Terminate on the original

DLL,
never lets go of it's reference to it, even after all workbooks are

closed.
[...]


My guess is that you have references in managed code which haven't been
garbage collected yet.

Jens.

--
http://ManagedXLL.net/
Replace MSDN with my first name when replying to my email address!


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default RTD Bug? or perhaps a feature?

A nice guess, and one that I entertained, however it falls down on
explaining why only the first instance does not get destroyed but all
subsequent instances do. I set all references to null and explicitly place a
call to GC.Collect in the ServerTerminate method.

Guess again.

"Jens Thiel" wrote:

"Another frustrated developer"
. com wrote in message
...
Interesting....

It seems that Excel, although calling Server Terminate on the original

DLL,
never lets go of it's reference to it, even after all workbooks are

closed.
[...]


My guess is that you have references in managed code which haven't been
garbage collected yet.

Jens.

--
http://ManagedXLL.net/
Replace MSDN with my first name when replying to my email address!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find feature Freek Versteijn Excel Discussion (Misc queries) 1 December 9th 08 06:31 PM
IsBlank( ) feature FARAZ QURESHI Excel Discussion (Misc queries) 2 January 19th 07 08:34 PM
Sort feature [email protected] Excel Discussion (Misc queries) 3 January 8th 07 05:57 PM
Template Feature Mike Rogers Excel Discussion (Misc queries) 0 November 30th 06 01:19 AM
Yes / No Feature DCSwearingen Excel Worksheet Functions 1 August 5th 05 05:04 PM


All times are GMT +1. The time now is 07:19 PM.

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

About Us

"It's about Microsoft Excel"