-1

If I were to write a macro in python for libreoffice calc and save the file as an xlsx file will the macro work in ms excel on a windows pc?

I am thinking of learning python so I can write macros for ms excel in python on libreoffice.

heinst
  • 8,520
  • 7
  • 41
  • 77
user3125707
  • 399
  • 2
  • 5
  • 20

2 Answers2

1

No, Excel only natively supports macros written in VBA.[1]

Alain
  • 26,663
  • 20
  • 114
  • 184
1

Sort of.

You won't be able to directly use python macros from libreoffice, but you can use python to automate MS office

See here: Using Python to program MS Office macros?

I've used the win32Com method, and it did everything i needed. I don't think there's much benefit of doing things this way unless you're using some of the power of python for other interactions.

Community
  • 1
  • 1
RowanC
  • 1,611
  • 10
  • 16
  • Hi rowanc I didn't understand what u are trying to say. If I write the python macros from within libreoffice why won't I be able to use them from libreoffice? Also I thought python was a crossplatform language so why won't it work in ms office under windows? Thanks – user3125707 Jul 15 '14 at 09:39
  • You should be able to write macros written for libre office, with libreoffice. Your post asked if you could use macros that run in libre office, save as xlsx, and use in excel, this is not possible (to the best of my knowledge). When libreoffice saves xlsm, i'm pretty sure it won't save the macros, and if it does, the object model is different between excel and libreoffice. Think of them as two different people from different languages doing the same job. They can both do the job fine, but the instructions are in a different language. – RowanC Jul 15 '14 at 23:49