Documentation (continued) Home
As a result of the recent rapid developments, this online documentation is not complete or up to date. While we are working on this issue - please direct all your questions to support@excel4net.com

Whether you have a question or need some assistance to get started, please contact us.

We will be happy to help,
Excel4Net team

Example 2:


Let’s continue with the function that returns MTM value for the interest rate swap as a NPV difference between pay and receive cashflow streams:

public static  double  GetMtm(List<Cashflow> payLeg, List<Cashflow> recLeg) 
{ 
// code not shown 
} 
where Cashflow is a class defined as:
public class Cashflow 
{ 
   public DateTime AccrualStartDate; 
   public DateTime AccrualEndDate; 
   public DateTime PaymentDate; 
   public double   CouponRate; 
   public double   AccruedAmountFV; 
   public double   AccruedAmountPV; 
} 

In a spreadsheet each stream of cashflows is defined as range of cells:


Intuitively this range of cells can be though as a List<Cashflow> collection, where each row is an item within the collection and each column is a member of the individual item:


To specify such a conversion:


  • start up the configuration tool (Excel4Net.Configuration.exe)

  • in “File” menu, click “New configuration”

  • in “File” menu, click ”Add assembly”, browse for and open Excel4Net.Samples.dll:


  • drag and drop “GetMtm” treeview item to the listbox on the right:


  • double click on the Func(”Swap”, “GetMtm”) item or right mouse click and choose “Edit func()-tion” in the popup menu to open the “Function editor” window:


  • for both parameters of the function select a “Variant(rows are elements) to List” auto-conversion

  • optionally, you may change a name of the Excel function, add a description to parameters, etc

  • in “File” menu, click “Save configuration” and save file into the same folder with .NET assembly and the spreadsheet you want to call this function from




  • The next time you open your spreadsheet (you may have to open a new instance of Excel), =Func(“Swap”, “MTM”) function should be available in the “Insert Function” window. To print a help for the function just press CTRL-P.




    Debugging, Testing, Support and Maintenance:

    Anyone who writes code generally spends 30%-70% of the overall development time on debugging and testing tasks, before a solution is actually ready for delivery.

    Even after a solution is deployed on the user’s machine, development cycle is not over. Users will typically ask for small or big enhancements, new features or just bug fixes.

    To make debugging, testing, and support and maintenance tasks easier and to save your time, Excel4Net has powerful built-in diagnostic capabilities.

    To use them, please right mouse click on the Excel4Net icon in the tray window, then click “Diagnostics” menu item in the pop up menu:


    That will bring up the “Diagnostics” window that is divided into four tab pages:

  • Log

  • Statistics

  • Assemblies

  • Configurations

  • Log page - all calls are logged, all input parameters and return values are dumped here. All the errors are trapped and displayed here as well. Whether a function call has failed because of a “garbage input” or something else went wrong – errors are automatically highlighted to help you immediately spot a problem:


    Statistics page shows how many times each function has been called, number of errors per function, and detailed timing information:


    A problem that often comes up during Excel development – solution loads an assembly bound to a wrong dependent assembly. Assemblies page tells you what exactly has been loaded by Excel and from there:


    Configuration page lists all the .config files loaded by Excel:





    Remote Desktop Viewer

    is the quickest way to find and fix a spreadsheet problem if it occurred on a user’s computer.

    Just connect to a user’s machine:


    and then use a keyboard and a mouse to control the user's computer in to find out is causing the issue and to resolve it remotely (if a user has more than one monitor - you will be able to see and control all of them):


    To make a user’s computer available for remote connections, ask a user to start a remote client:


    Even when a remote client is running, users don't have to worry – every remote connection must be manually accepted by user.



    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.

    Download for free
    Version 2.0.7 (7/8/2009)