The ABC Auditing Company decides to migrate to OpenOffice.org. The firm gets a copy of OOo installed on every machine and trains its employees to work with documents in ODF (Open Document Format), as well as with older documents that were prepared in the MS Office format, in OOo. Everything seems to be going smoothly.
Suddenly, however, it’s noted that a few important Excel (spreadsheet) documents with macros are not functioning properly in OOo. They may need a developer to rewrite VBA code in OOBasic. This may take some time and money, as going back to the old environment is not an option any longer. The manager now wishes he had a copy of OOo that could handle VBA also. Thankfully, this is not a dream and is possible with some versions of OOo that support VBA. ABC Auditing should have chosen the right version when it decided to migrate to OOo.
VBA macros
Visual Basic for Applications (VBA) is an implementation of Microsoft’s Visual Basic integrated into Microsoft Office applications. You may wonder about the need for such a discussion in a FOSS article. Well, many organisations are migrating to OOo nowadays, but a lot of their old documents are in the MS Office format. When an MS Office document is opened in OOo, the VBA macros present in them are unusable under most circumstances. So VBA macros have to be rewritten in OOBasic to avail the same functionality in OOo. This becomes a major issue in migrating to OOo. To overcome this, recent versions of OOo come with support of VBA interoperability. The Go-oo flavour of OOo is a better choice for this purpose.
Some background on Go-oo
Go-oo is Novell’s effort, which is an addition to Sun’s core. Some pending issues in the upstream have been fixed and it comes with some additional functionality. Here are a few advantages that the Go-oo people claim, when compared to other flavours of OOo.
- Quicker start-up
- VBA support and better Excel interoperability.
- A quick starter in the system tray.
For a complete list of the advantages, please visit go-oo.org/discover.
So, thinking of getting a copy of Go-oo? You will find that pre-built binaries for Linux, Mac and Windows are available from go-oo.mirrorbrain.org/stable.
At present, Go-oo support for VBA is to a much greater extent for Excel spreadsheets compared to only a little for Word documents. There’s no VBA support for Power Point presentations, yet. You need to build Go-oo from sources to do some hacks or add VBA bits. The rest of this article explains how to build Go-oo and how to contribute by adding VBA properties and objects.
VBA support in OOo
The latest versions of upstream OOo and many versions of Go-oo come with VBA support. When an Excel document is opened in OOo, the VBA code used for macros is loaded as it is, with an additional line at the beginning—Option VBASupport 1. This tells the macro handler of OOo to process the code as per VBA specifications instead of default OOBasic.
To enable/disable VBA Model, go to Tools→Options→Load/Save→VBA Properties. For each type of document, opt for load/save options. If the option ‘Executable code’ is not selected for Excel documents, the VBA code in Excel is loaded as comments when opened in OOo, just like in older versions that don’t have VBA support.
OOo architecture
The OOo source is divided into modules. The advantage of this modular design is that each module can be rebuilt independently if you want to update the concerned libraries to reflect changes. For example, if a Calc related bug needs to be fixed, only the sc module should be rebuilt.
Around 200 modules exist in the current source code—at a location like ooo-build/build/ooo3??-m??. For example, the source tag ooo310-m15 means OOo 3.1.0 version, with milestone 15.
Some of the important modules are:
- sc is for Calc
- sd is for Draw and Impress
- sw is for Writer
- chart2 is for Calc charts
- formula is for math
- oovbaapi is for VBA support
- sfx2 is a framework for Calc, Writer, Impress, etc.
- vcl is the UI Core
It is not advisable to change modules in the bottom or middle layers like vcl, svx, etc. This is because changing these modules may lead to many side effects. Always try to fix issues by changing the top layer.


































