ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Function Addins (https://www.excelbanter.com/excel-programming/321513-excel-function-addins.html)

Jerry

Excel Function Addins
 
Can someone tell me what the advantages and disadvantages are of building
addins as a COM addin and a XLL addin?

Rob van Gelder[_4_]

Excel Function Addins
 
XLL will run on any version of Excel
Automation (COM) Add-Ins work from Excel 2000+ (UDF from 2002+)


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Jerry" wrote in message
...
Can someone tell me what the advantages and disadvantages are of building
addins as a COM addin and a XLL addin?




Fredrik Wahlgren

Excel Function Addins
 

"Rob van Gelder" wrote in message
...
XLL will run on any version of Excel
Automation (COM) Add-Ins work from Excel 2000+ (UDF from 2002+)




These add-ins also behave slightly different. Let's say you have a UDF that
takes two integer values. There's an xll version and an automation version.
Now yiu enter this:

=MyFunc(32)

If you use an xll, Excel will pass 32 and 0. With a COM add-in, excel won't
call your function unless all parameters have been given values. This is
something I found out when I made a VB.NET and a C# version of a simple
add-in. It didn't matter if the parameters were declared optional in VB.NET.
I haven't tested this with VB6.

If you want to make a COM add-in written in C# or VB.NET, you may want to
create a shim dll which Makes things more complicated. There are a few other
differences as well. Tell us more about the add-in you want to code.

/Fredrik



Jerry

Excel Function Addins
 
I have written several functions in VBA and wish to move them to C++. To
increase the speed. I also want to use it to help protect much of the code
from prying eyes. What I would like to know is how the two types compare in
speed, the complexity of building function and anything that would be a
benefit over the other.

I have Visual Studio .Net Developer edition with Office XP.

Another question I have is if I were to do a xll addin How do you do it in
..Net. All articles Ive seen show it being done in visual studio 6.0 in xp
they have no wizard to get it started.



"Fredrik Wahlgren" wrote:


"Rob van Gelder" wrote in message
...
XLL will run on any version of Excel
Automation (COM) Add-Ins work from Excel 2000+ (UDF from 2002+)




These add-ins also behave slightly different. Let's say you have a UDF that
takes two integer values. There's an xll version and an automation version.
Now yiu enter this:

=MyFunc(32)

If you use an xll, Excel will pass 32 and 0. With a COM add-in, excel won't
call your function unless all parameters have been given values. This is
something I found out when I made a VB.NET and a C# version of a simple
add-in. It didn't matter if the parameters were declared optional in VB.NET.
I haven't tested this with VB6.

If you want to make a COM add-in written in C# or VB.NET, you may want to
create a shim dll which Makes things more complicated. There are a few other
differences as well. Tell us more about the add-in you want to code.

/Fredrik




Fredrik Wahlgren

Excel Function Addins
 

"Jerry" wrote in message
...
I have written several functions in VBA and wish to move them to C++. To
increase the speed. I also want to use it to help protect much of the code
from prying eyes. What I would like to know is how the two types compare

in
speed, the complexity of building function and anything that would be a
benefit over the other.

I have Visual Studio .Net Developer edition with Office XP.

Another question I have is if I were to do a xll addin How do you do it in
.Net. All articles Ive seen show it being done in visual studio 6.0 in xp
they have no wizard to get it started.

If your add-ins have already been written, it's easier to make a
COM/Automation add-in. Both are *much* faster than VBA.


Here's a link where you can find out more about xll's
http://www.whooper.co.uk/excelstuff.htm#tip2

This link is also of interest
http://www.managedxll.net/excel/net/xll/en/index.html

/Fredrik




All times are GMT +1. The time now is 12:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com