I’ve updated the java-based component using @mlauber71 's suggestion for finding the required java libraries in the KNIME plugin folder, so hopefully this is now compatible with all KNIME AP installations rather than just Windows.
The component I uploaded before has been updated, but having now re-created it using KNIME 4.7.8, I have also re-uploaded it under the more general name “Recalculate Excel”
For anybody interested in the internals… the additional component it uses for finding (attempting to find) the required java libraries from the plugin folder is this:
The idea here is that the java snippet requires particular libraries to be made available in the form of java archive (jar) files. In this case it is the Apache POI library that it uses. However, in different releases of KNIME, the libraries change so it is difficult to handle this directly in the java snippet config.
For example in KNIME AP 5.3.2 the bundled poi libraries are:
whereas in KNIME AP 4.7.8 they are:
and in 5.2.5 they are:
Not all of them are required, but from one version to the next, the bundled jars can change. To (try to ) handle this, I wrote the “Collect Required Plugin Jars” component. This is configured with the “wildcarded” names of all the plugin libraries that I have seen mention “poi” in their name:
It searches the plugins folder for the current installation (now cross-OS compatible thanks to @mlauber71), and finds all the files that match the supplied wildcard specification, and returns them as a String List flow variable “JarFileList”
This is then passed to the Java Snippet (or in this case Java Edit Variable) via the jarFiles configuration
With that done, and all other things being equal, the java code can work across different versions of KNIME, provided that the same basic java libraries/plugins continue to be bundled, and have compatible file naming. Obviously if that changes in future, an update to the component may be required, but for now it seems to work.
The code contained within the Java Edit Variable node that performs the Excel recalculation was generated by chatGPT (see conversation here) and then manually modified to work with a Java Edit Variable node.