Application.RegisterXLL - RTD server is not started when excel is launched 'as admin'

199 views
Skip to first unread message

Evgen Ischenko

unread,
May 8, 2017, 8:44:41 AM5/8/17
to Excel-DNA
Hello everyone,

I have a COM add-in and ExcelDna add-in.
To load ExcelDna add-in I use next code inside the COM add-in:
Application.RegisterXLL(xllFile)
where xllFile is a full path to the .xll file with UDFs and RTD server.

Everything works perfectly fine in usual conditions, but when Excel is launched 'as admin' RTD server never starts and functions that call it just return #N/A.

Also Event Log is created in such case under 'Windows Logs\System' with next content:


Has anyone seen such behavior? All formulas registered correctly, but RTD server can not be accessed.
To be honest, I have no clue as to why this issue happens and would be grateful if anyone could shed some light on it.

Simple example solution with 2 projects (COM and ExcelDna add-ins) can be found here.

Regards,
Eugene

Govert van Drimmelen

unread,
May 8, 2017, 8:53:32 AM5/8/17
to exce...@googlegroups.com
Hi Eugene,

1. If you start Excel as admin (without the COM add-in) and then load the Excel-DNA add-in directly (using File-> Open), does that make any difference? 
(I just want to eliminate the COM add-in and the way the .xll is loaded as possible complications.)

2. Can you confirm the exact Excel-DNA version you are using? Recent Excel-DNA versions have improved the RTD dynamic RTD registration in different settings.

3. What do your RTD calls look like? The second parameter to the RTD call is the server name, and should be null or an empty string. Your message seems to indicate that Excel might be trying to look for the RTD server on another machine, which would happen if the second parameter of the RTD call has some interesting value.

-Govert



From: exce...@googlegroups.com [exce...@googlegroups.com] on behalf of Evgen Ischenko [evgen.i...@gmail.com]
Sent: 08 May 2017 02:44 PM
To: Excel-DNA
Subject: [ExcelDna] Application.RegisterXLL - RTD server is not started when excel is launched 'as admin'

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.

Evgen Ischenko

unread,
May 8, 2017, 9:34:19 AM5/8/17
to Excel-DNA
Hi Govert,

Thank you for a quick reply!

1. If I start Excel as admin (without COM add-in) and add Excel-DNA add-in through 'File -> Options -> Add-Ins -> Excel Add-ins -> Browse' the RTD functions still do not work. But when I load Excel-DNA via 'File -> Open' everything works.

2. I am using Excel-DNA NuGet package version 0.33.9, referenced ExcelDna.Integration Assembly's version is 0.33.5730.40390. Target .NET framework is 4.0

3. Simplest example call for RTD server I am using looks like next:
public const string RtdProgId = "testRtdServerId";

[ExcelFunction]
public static object RtdFunction()
{
    return XlCall.Excel(XlCall.xlfRtd, RtdProgId, null, null);
}
RtdProgId is also used in IRtdServer implementation via ProgIdAttribute
If the second parameter should be empty does it mean that Excel-DNA will pass function to the required RTD server by itself? 
And what if there are multiple IRtdServer implementations (although it is not the case currently)?

Regards,
Eugene
To post to this group, send email to exc...@googlegroups.com.

Govert van Drimmelen

unread,
May 8, 2017, 10:04:51 AM5/8/17
to exce...@googlegroups.com

Hi Eugene,

 

  1. Do you mean that you are testing in both cases “As Admin”, but the behaviour is different if you choose 'File -> Options -> Add-Ins -> Excel Add-ins -> Browse' or 'File -> Open'? But in both cases the .xll does load and the UDF functions are available, only the RTD server does not work, and you get the event log entry? If so, perhaps the add-in is being copied to another directory by Excel when it is installed. You might have to Google about this a bit, but Excel sometimes does this, I don’t know the pattern. Having the .xll being copied, but not some other .dlls that you need might cause strange problems. Excel-DNA does not distinguish between these two ways of opening the add-in.

 

  1. You might, as a test, try the pre-release package of Excel-DNA v0.34 from NuGet. It includes some improvements to the COM /RTD registration.

 

  1. You can try to call the functions with an empty string for the server name, thus as

 

return XlCall.Excel(XlCall.xlfRtd, RtdProgId, "", null);

 

or even with a space

 

return XlCall.Excel(XlCall.xlfRtd, RtdProgId, " ", null);

 

just to see if that makes a difference, and whether the event log entry changes when you do this.

 

 

Otherwise we might have to make a small test add-in and set up some extra logging. But I suggest the above ideas first.

 

-Govert

To post to this group, send email to exce...@googlegroups.com.

Evgen Ischenko

unread,
May 10, 2017, 9:40:53 AM5/10/17
to Excel-DNA
Hi Govert,
  1. Behavior is the same for both cases, my bad. RTD server works well if add-in added when Excel is launched as administrator. But it does not work in 'admin' mode if add-in was installed while in normal mode.
  2. It seems like pre-release version of Excel-DNA fixes this issue. Is there a chance to know when new version of Excel-DNA will be released?
Regards, 
Eugene
Reply all
Reply to author
Forward
0 new messages