ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2003: custom function with dotnet (https://www.excelbanter.com/excel-programming/285120-excel-2003-custom-function-dotnet.html)

Thomas Mutzl

Excel 2003: custom function with dotnet
 
Is it possible (and HOW?) to write a user defined
(=custom) function in managed code??

In a Excel Cell, I want to use
=Test(12)

With VBA I would write a function in module like
Function Test (x as integer) as integer
Test = x*x
End Function

Now I want to implement this udf with Visual Studio Tools
for Office. Using C#, the function should look something
like
public static int Test(int x)
{
return x*x;
}

But I have no idea, how to make the Excel-Workbook able,
to use my function in the "managed code extension"...

Thanx for your advice!!

Thomas

Jens Thiel[_2_]

Excel 2003: custom function with dotnet
 
"Thomas Mutzl" wrote
Is it possible (and HOW?) to write a user defined
(=custom) function in managed code??


Have a look at http://ManagedXLL.net/ where the answer would look like this:

using ManagedXLL;

[WorksheetFunction]
public static int Test(int x)
{
return x*x;
}


Jens.



Thomas Mutzl

Excel 2003: custom function with dotnet
 
Thanks for the response!

But does this mean, that without a third-party product,
it is not possible to write a "managed udf" ?!?!?!?

BTW: the product you suggested is not really cheap...

-----Original Message-----
"Thomas Mutzl"

wrote
Is it possible (and HOW?) to write a user defined
(=custom) function in managed code??


Have a look at http://ManagedXLL.net/ where the answer

would look like this:

using ManagedXLL;

[WorksheetFunction]
public static int Test(int x)
{
return x*x;
}


Jens.


.



All times are GMT +1. The time now is 10:16 AM.

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