Serving the Quantitative Finance Community

 
User avatar
ioancw
Topic Author
Posts: 3
Joined: June 1st, 2005, 12:14 pm
Location: London

Excel Automation Add-in in C#

February 6th, 2006, 6:34 pm

I'm trying to write my own user defined functions in Excel using C# and the latest version of .Net (I've downloaded the latest express edition).I came across the following blog, with instructions on how to do this using an Automation add-in in C#.http://blogs.msdn.com/eric_carter/archi ... 7.aspxI've followed all the steps but I can't see my function in the list of available functions.Have any of you done something similar, or prefer an alternate method, i.e. C++ and XLL?I'm open to suggestions.Cheers
 
User avatar
Cuchulainn
Posts: 22934
Joined: July 16th, 2004, 7:38 am

Excel Automation Add-in in C#

February 6th, 2006, 6:45 pm

QuoteOriginally posted by: ioancwI'm trying to write my own user defined functions in Excel using C# and the latest version of .Net (I've downloaded the latest express edition).I came across the following blog, with instructions on how to do this using an Automation add-in in C#.http://blogs.msdn.com/eric_carter/archi ... 7.aspxI've followed all the steps but I can't see my function in the list of available functions.Have any of you done something similar, or prefer an alternate method, i.e. C++ and XLL?I'm open to suggestions.CheersWe use Automation and COM AddIns in C++ and C#. But no XLL because at the risk of causing a riot this xll technology is frozen in time. Of course it still work but it is more work.I have discussed these addins in chapter 29 of my C++ book. I quote from your link://///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Unfortunately, Excel does not support or recommend writing an XLL that uses managed code. If you are willing to take your chances that your XLL might not run in current or future versions of Excel, there are solutions available that enable this scenario—search the web for “managed XLL///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////I find this scary. It is not supported.
Last edited by Cuchulainn on February 5th, 2006, 11:00 pm, edited 1 time in total.
 
User avatar
ioancw
Topic Author
Posts: 3
Joined: June 1st, 2005, 12:14 pm
Location: London

Excel Automation Add-in in C#

February 6th, 2006, 6:48 pm

Thanks for the reply. I'll check out your book at the Library at work tomorrow (they should have it).Cheers
 
User avatar
Cuchulainn
Posts: 22934
Joined: July 16th, 2004, 7:38 am

Excel Automation Add-in in C#

February 6th, 2006, 6:55 pm

QuoteOriginally posted by: ioancwThanks for the reply. I'll check out your book at the Library at work tomorrow (they should have it).CheersYou're welcome. The step-by-step account is in chap 29. There are about 6-7 major steps to do by hand but I believe that there is a wizard to do it for you. It's a lot of work until you get the hang of it. See our COMUTILS.cpp which has a number of handy functions for registration and so on.Daniel
 
User avatar
DominicConnor
Posts: 41
Joined: July 14th, 2002, 3:00 am

Excel Automation Add-in in C#

February 7th, 2006, 11:47 am

But no XLL because at the risk of causing a riot this xll technology is frozen in time. Of course it still work but it is more work.Not a riot, just a little murmer of dissent.XLLs are not frozen in time. I'm a tech beta tester for Excel 12, and XLLs are being updated quite substantially. Actually all of E12 is changing, it is a very different tool.
 
User avatar
ioancw
Topic Author
Posts: 3
Joined: June 1st, 2005, 12:14 pm
Location: London

Excel Automation Add-in in C#

February 7th, 2006, 9:14 pm

Got this working now. Just had to download a patch to Excel to deal with the latest version of . Net......
 
User avatar
mj
Posts: 12
Joined: December 20th, 2001, 12:32 pm

Excel Automation Add-in in C#

February 7th, 2006, 11:49 pm

QuoteOriginally posted by: DCFC But no XLL because at the risk of causing a riot this xll technology is frozen in time. Of course it still work but it is more work.Not a riot, just a little murmer of dissent.XLLs are not frozen in time. I'm a tech beta tester for Excel 12, and XLLs are being updated quite substantially. Actually all of E12 is changing, it is a very different tool.this is terrible news. everyone's got the hang of xlls and excel. who wants change?! will old xlls work?
 
User avatar
mtraudt
Posts: 0
Joined: February 21st, 2006, 3:40 pm

Excel Automation Add-in in C#

February 22nd, 2006, 1:27 pm

The Automation approach provided by MS for writing managed worksheet functions is, in our experience, not a good solution for supporting trading desks. One reason (the biggest one) is that it uses COM as the underlying technology, and this creates significant deployment issues.I strongly recommend that anybody wanting to write Excel worksheet functions in .NET investigate the "managed xll" approach suggested by an earlier poster.We have developed our own framework based on this approach and it is in use on hundreds of desktops, running .NET 1.1/2.0, Windows 2000/XP, and Excel 2000/2002/2003. In addition to avoiding the deployment issues that come with COM, by leveraging the flexibility of the Excel C SDK and the power of the .NET platform, we are able to offer many value-added features, including: automated generation of online docs, support for custom marshalers, and the ability to run multiple versions of addins simultaneously (side-by-side execution).I understand that this does not come with an official blessing from MS, but it does work and what little I have heard about Excel 12 suggests that not only is the Excel C SDK not a dead end, but it is being improved.
 
User avatar
DominicConnor
Posts: 41
Joined: July 14th, 2002, 3:00 am

Excel Automation Add-in in C#

February 22nd, 2006, 10:35 pm

this is terrible news. everyone's got the hang of xlls and excel.I'm notsure quite everyone has got the hang of XLLs Actually most people have quite appalling understanding of Excel as well. who wants change?! More than you might think. Excel has several large structural flaws and simply cannot be made to work proplery in a modern trading floor environment without structual internal changes.Some of these inevitably need to percolate up.If you want a slow old Excel, then E11 will work for years to come.will old xlls work?Yes, one day...
 
User avatar
Cuchulainn
Posts: 22934
Joined: July 16th, 2004, 7:38 am

Excel Automation Add-in in C#

February 23rd, 2006, 7:57 pm

QuoteOriginally posted by: DCFCthis is terrible news. everyone's got the hang of xlls and excel.I'm notsure quite everyone has got the hang of XLLs Actually most people have quite appalling understanding of Excel as well. who wants change?! More than you might think. Excel has several large structural flaws and simply cannot be made to work proplery in a modern trading floor environment without structual internal changes.Some of these inevitably need to percolate up.If you want a slow old Excel, then E11 will work for years to come.will old xlls work?Yes, one day...Let's plan now for the future.
 
User avatar
AVt
Posts: 90
Joined: December 29th, 2001, 8:23 pm

Excel Automation Add-in in C#

February 23rd, 2006, 8:34 pm

@DCFC:Are there issues with Excel12 for using _DLL_ (without using SDK, may be even not written using MS)?
 
User avatar
tetoche
Posts: 1
Joined: November 13th, 2005, 7:11 pm
Location: Paris

Excel Automation Add-in in C#

July 1st, 2006, 2:35 pm

Hi ioancwtry the page https://blogs.msdn.com/eric_carter/arch ... 127.aspxIt works better
 
User avatar
jluo02
Posts: 0
Joined: November 9th, 2006, 10:56 pm

Excel Automation Add-in in C#

November 10th, 2006, 2:42 pm

Hi, I have the same problem with my excel. Can you please kindly let me know which patch (url) you were using to resolve the problem? -thanks in advance.
 
User avatar
jluo02
Posts: 0
Joined: November 9th, 2006, 10:56 pm

Excel Automation Add-in in C#

November 13th, 2006, 3:26 pm

ioancw,I'm having the same problem as you had before. No add-in function seen on the available list. Can you please let me know which patch that you downloaded make it works. If you have the link (URL) for the patch, that'll be great too. I'm using Excel 2003 and C# 2005 express edition.Thanks in advance,Jane
 
User avatar
jluo02
Posts: 0
Joined: November 9th, 2006, 10:56 pm

Excel Automation Add-in in C#

November 13th, 2006, 3:34 pm

Ok, thanks for no replying.Finally, after I reboot the machine and let it ran for a weekend and it works. Go figure.