Introduction
How does it work?
Jinx is an Excel Add-In that runs Java, Scala or Kotlin code in Excel.
It has a config file where you configure the Java classpath and what classes to load. When Jinx starts up it loads those classes and looks for annotated methods, which are exposed to Excel.
For example, an Excel user defined function (UDF) to compute the nth Fibonacci number can be written in Java as follows:
The @ExcelFunction annotation is detected by Jinx and the method is exposed to Excel:
Excel types are automatically converted to Java types based on the signature of the method. Where there is no simple conversion (e.g. when returning an arbitrary class instance from a method) Jinx caches the returned object and returns a handle to it to Excel. When another function is called with that handle Jinx retrieves the object from its cache and passes it to the method. Jinx keeps track of cells referencing objects so that once an object is no longer referenced it can be garbage collected.