Excel 2003: custom function with dotnet

  • Thread starter Thread starter Thomas Mutzl
  • Start date Start date
T

Thomas Mutzl

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
 
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-----
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.


.
 
Back
Top