Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Excel managed-code add-in - not recommended by MS?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SmartGuy - 20 Mar 2008 20:13 GMT
In Eric Carter's blog he makes this statement: ".. Excel does not support or
recommend writing an XLL that uses managed code."

Does this mean that I can but probably should not use managed code to write
a function that can be called from Excel?  

For example, I'd like to have a '=getData()' function in excel that calls my
.net automation add-in and gets data from a database or web service.

is this bad?  Unsupported by Microsoft?  Am I on thin ice?  Am I paranoid?  
:)  

Feedback please!

Eric's blog:
http://blogs.msdn.com/eric_carter/archive/2004/12/01/273127.aspx

Signature

SmartGuy

Andrei Smolin [Add-in Express] - 24 Mar 2008 15:26 GMT
Hello,

It is supported. Eric Carter states that Excel doesn't support managed XLL
add-ins. It also suggests using Excel Automation add-ins instead.

But we don't recommend developing an Automation add-in without a shim
written in C++ or Delphi (the shim should create a separate AppDomain and
load the add-in into it). Otherwise, the add-in will be loaded into the same
AppDomain as Excel and any exception in the add-in will crash Excel.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
www.add-in-express.com

> In Eric Carter's blog he makes this statement: ".. Excel does not support
> or
[quoted text clipped - 15 lines]
> Eric's blog:
> http://blogs.msdn.com/eric_carter/archive/2004/12/01/273127.aspx
Govert van Drimmelen - 25 Mar 2008 10:40 GMT
Hi SmartGuy,

I think you're paranoid ;-)

Even though creating Excel .xll add-ins using managed code is not
supported by Microsoft, it works very well, and is very fast. One has
to be careful not to leak exceptions, which will indeed crash Excel,
but it is _much_ easier to make trouble using unmanaged C/C++ add-ins.
The AppDomain and CLR version loading issues that appear when making
Automation Add-ins are similar when .xll add-ins are involved.
Automation Add-Ins have registration and referencing issues, and only
work on newish versions of Excel. The .xll model just works better,
and has been improved a lot in Excel 2007.

When creating Excel .xll add-ins using C# or VB you'll need some
marshaling layer. ManagedXll is a commercial full-featured option, and
ExcelDna (http://groups.google.com/group/exceldna) is a free, open-
source alternative. I'm pretty sure the developers of the commercial
ManagedXll library will support you with any problems you run into,
probably much better than Microsoft would support your native
code .xll. I'm happy to help you when usng ExcelDna.

So I'd say give it a go, and post back here with your findings.

Cheers,
Govert
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.