Tuesday, March 4, 2008

open office spreadsheet scripting

I would like to be able to use output from a program to control an open office spreadsheet. Ideally this solution should work in both windows and linux. This blog entry is a record of my experiences.

Posted a how to question to the open office forum. Got a number of "yes it can be done" responses and some links to reference sites.

The available options seem to be c++, python, java, and beanshell ( a java scripting ) language. I'm going to try c++ first, then python, then beanshell, then java.

Tried c++. Started by downloading the open office sdk. It does not seem very well configured for windows. There are no include files but there are .idl files that are used to create include files. The tool for doing this is an executable called cppumaker and is available but it's not clear how to use it. It's invoked through the makefile which does not work on cygwin. I'm going to look for some cppumaker documentation but not for too long.

Found documentation for cppumaker but it's not easy to follow. On to python.

Python is a winner. Open office has a built in python and I found this article that tells how to interface to open office. The article uses open office writer for its example but I expect that the techniques will be easily adaptable to calc.

No comments: