Documentation Home

Excel4Net provides a simple common interface between Excel and .NET and provides diagnostics, facilitates testing, generates user documentation and supports users’ remotely.

Excel4Net shields developers from Excel’s syntax and object mode, making possible to re-use existing .NET components with no need to “touch” or modify them. Virtually any method of .NET type could be exposed to Excel without any changes to a .NET assembly.

To see what Excel4Net can do, let’s have a look at two examples. Example source code and compiled .NET assemblies are included in the installation package.

Example 1:

You have implemented Black-Scholes option pricing formula and compiled it into Excel4Net.AutoSamples.dll assembly:
public class BlackScholes 
{ 
    public double Price(string CallPutFlag, double S, double X, double T, double rate, double v) 
    { 
        //code not shown 
    } 
} 

To expose Price method as an Excel function:

  • copy Excel4Net.AutoSamples.dll assembly and the spreadsheet into the same folder

  • other deployment modes:

  • copy all your files (.NET assemblies, spreadsheets and, optionally, configuration files) to the same folder and specify its location in the userFuctions configuration variable of the Excel4Net.Main.dll.config file.

  • copy all of your files to any subfolder (you can create one if you’d like) of Excel4Net installation folder

  • open the spreadsheet and type =FUNC() in any cell of the worksheet, then press “ENTER” to bring up “Insert Function” window:


  • on the left pane - you can see all public methods defined in Excel4Net.AutoSamples.dll


  • tick “Examples” checkbox to see how this function can be called from a worksheet cell or using a VBA code:


  • press OK button or “ENTER” to insert the function call to the active worksheet cell (C1):


  • correct the inputs and check the result:


  • Done!

    All you have had to do was to copy the .NET assembly and the spreadsheet to the same folder, and that was it!


    More documentation (second example and main features) >>
    In addition to just two examples covered here, the installation package has a dozen more – so you could see for yourself how Excel4Net could fit into your needs.

    free Download
    Version 2.0.7 (7/8/2009)