Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find feature | Excel Discussion (Misc queries) | |||
IsBlank( ) feature | Excel Discussion (Misc queries) | |||
Sort feature | Excel Discussion (Misc queries) | |||
Template Feature | Excel Discussion (Misc queries) | |||
Yes / No Feature | Excel Worksheet Functions |