quant
quant

Reputation: 23092

How do I debug an OpenOffice function macro?

I'm trying to do some basic spreadsheet tasks within OpenOffice for which the standard functions won't suffice, so I'd like to write my own macro in BASIC.

However, my function doesn't work. How do I go about debugging it? I tried inserting MsgBox("something") throughout my code but this has no effect (no message box appears when I call the function from Calc.

I also tried placing breakpoints throughout the function, which Calc simply ignores.

How can I debug my function?

The debugging guides seem to be more about subroutines than functions. I noticed that many people have commented that python would be a better option. Is that because the Basic implementation in OpenOffice is poor? Am I encoutering IDE bugs or are these features?

Upvotes: 0

Views: 1461

Answers (1)

Axel Richter
Axel Richter

Reputation: 61915

I can't reproduce this behavior. If I have a Function created in the IDE then I can use all what you say you can't: MsgBox and the observer. For using the observer of course the IDE has to remain open. See screenshot:

enter image description here

I have called the function as =MYFUNC(23) in a Calc cell, then I have fetched the IDE window to front and have run the code step by step.

Whether and how python would be a better option, you should ask the people which comment this would be so much better ;-). It is not my opinion.

Little introduction how to use python with openoffice: https://wiki.openoffice.org/wiki/Extensions_development_python

Upvotes: 0

Related Questions