One can create MS Excel tables using Python / Java syntax is a completely programmable way. The output files can be opened in MS Excel or OpenOffice / Libre office.
Here is a small Jython example that creates a table with custom fields.
You can open this file in MS Excel and look inside. Or one can build custom files like this: