Loading XLL from VSTO

189 views
Skip to first unread message

KevinT

unread,
May 28, 2009, 12:20:21 PM5/28/09
to ExcelDna
I am trying to load an ExcelDna XLL programatically via a C# VSTO
addin. To load it I am calling...

Microsoft.Office.Interop.Excel.Application.AddIns.Add(xllFilePath,
null);

But I am getting the error below.

Loading the xll manually from that locatio (via File->Open) works
fine.

I haven't had much time to dig into it yet, but I thought I would ping
the group here to see if anyone has experience in doing this and had a
similar issue?

Thanks in advance - I will post back if I manage to come right on my
own :P



---------------------------
UI.Excel.Xll.xll Add-In Loader
---------------------------
A problem occurred while the add-in was creating an isolated
application domain and loading required assemblies.

The ExcelDna.Loader assembly could not be loaded from resource.

This is an unexpected error. Please report this error to the add-in
developer.

Additional error information: HRESULT 0x8013150A

This add-in is built with ExcelDna and is being loaded from the
following location:

C:\Documents and Settings\hbr\My Documents\KeyBlade
\KeyBlade.UI.Excel.Xll\0.0.0.3\UI.Excel.Xll.xll.
---------------------------
OK
---------------------------

KevinT

unread,
May 28, 2009, 12:25:17 PM5/28/09
to ExcelDna
Note - this same error also occurs when attempting to load via
Application.RegisterXLL(...)

Govert van Drimmelen

unread,
May 29, 2009, 5:24:25 AM5/29/09
to ExcelDna
Hi Kevin,

The error code 0x8013150A means COR_E_SECURITY.
The AppDomain for the ExcelDna add-in is created, but the assembly
stored in the resources cannot be loaded - AppDomain.Load fails with a
SecurityException. Maybe there is a problem accessing the GAC in that
context?

You can try to use the Fusion log viewer to get a better message. Do
you see any other input when running under a debugger?

What version of Excel, ExcelDna, Windows and the VSTO Add-in shim are
you using?
If you make the add-in without the COM shim, do you get the error?
Do you get the error on different machines?

--Govert--
Reply all
Reply to author
Forward
0 new messages