Ubuntu – How to make MS Excel macros work in Ubuntu

gnumericlibreoffice

I have a spreadsheet written in MS Excel, an .xls document, which contains macros. I'm having a problem finding a program what will allow me to open the document and the macros work.

I tried opening the document in LibreOffice and the macros won't work even though I went to Tools -> Options -> Load/Save -> VBA Properties -> and made sure Load Basic Code and Executable Code were both checked. I even went to Tools -> Options -> Security -> Macro Security -> and set it to Low. I converted the .xls document to a LibreOffice document and LibreOffice still won't run the macros.

I tried Gnumeric. Some of the macros seemed to work in Gnumeric but most of them didn't.

I installed Calligra and tried opening it with Sheets, but Calligra just freezes and I have to force quit out of it.

I do not have Windows, I do not own MS Office and have no means or desire to buy either one.

So, what other options are there left for me? I have been searching around Google/Bing but haven't found a solution yet. Any ideas? I'm running Xubuntu 12.04 64-bit.

Best Answer

This is not an Ubuntu question per se, but might be something new users may struggle with. In principle Excel macros only run in Excel, the language was not conceived to be portable. Here's what, for instance, the LibreOffice help says about it:

With a few exceptions, Microsoft Office and LibreOffice cannot run the same macro code. Microsoft Office uses VBA (Visual Basic for Applications) code, and LibreOffice uses Basic code based on the LibreOffice API (Application Program Interface) environment. Although the programming language is the same, the objects and methods are different.

In essence if you want a portable programme you should program on a portable platform. I'd say you have two options:

  1. Ask the author of the code to provide it to you on another language or support (I assume you are not the author since you don't own Excel).
  2. Purchase Excel and run it on Wine or PlayOnLinux
Related Question