Worksheet Functions
Calling functions written in Java using Jinx in Excel is exactly the same as calling any other Excel function written in VBA or as part of another Excel addin. They are called from formulas in an Excel worksheet in the same way, and appear in Excel’s function wizard.
Methods that are exposed as Excel functions are annotated using the @ExcelFunction annotation. They must be public methods, and can either be static or non-static (instance) methods. Classes with non-static methods must have a public default constructor.
For example, the following code adds a new function hello to Excel:
Once that code is built the class HelloFunction can be added to the Jinx config file:
Now when Excel is started the function hello exists and we can use it from a formula in a worksheet.