Are some actions disallowed in CALC Macros?

I think I need to learn more than two new things today :thinking:

Good call, I hadn’t realised I could do that. Thanks

If you really want to learn programming macros, MRI would be the essential helping tool which also includes something like a real macro recorder writing valid code in five langauges based on the interaction with the tool.
[Tutorial] Introduction into object inspection with MRI

However, if you do your first steps in programming within the API of LibreOffice, then you are certainly in the wrong class. IMHO, this API is radically unfriendly to beginners. And StarBasic as a language throws you back into the 90ies with no ties to the present programming universe. You end up with skills that are hardly transferable to anything beyond Libre/OpenOffice which is a petty and a waste of energy.
There is an old quote from Edsger Dijkstra: “It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: As potential programmers they are mentally mutilated beyond hope of regeneration.”

1 Like

I guess the third thing I learned is… not to bother - leave it to the pros

The language you choose does not matter. The major obstacle on your path is the thing you are talking to. The complexity of UNO makes a steep learning curve even for experienced professionals. Learning how to program UNO with StarBasic is like practicing for a pilots license on a 747 (UNO) with a garden chair as a pilot seat (StarBasic).

1 Like

Has convinced me that I should stop trying to put bells and whistles on a simple spreadsheet - that already performs the function for which it was created - in order to save myself a dozen keystrokes a day.

LO BASIC is designed on Visual Basic for Applications (VBA) which is designed on Visual Basic 6, which was released in 1998 or so. But I wouldn’t be quite as negative about learning LO BASIC macro programming as Villeroy is. If you stick to the kind that Prahlad Yeri shows and other examples where, say, you just are looping through …getCellByPosition(rowIndex,columnIndex) using nested loops to change something, etc., it isn’t that bad. In other words, you can do a lot by code-puppying, and if you learn along the way, so much the better. IMHO it beats trying to invent in-cell formulas with arrays, etc., that verge on madness. I’ve definitely gone down that rabbit hole, and probably will again, but would much rather program in BASIC.

Also, IMHO, all (serious) programming languages are what they are. If you know what is going on in the background, use COBOL, Fortran, Wolfram, BASIC, C++, C#, Java, whatever. You just use the tool in front of you. As Villeroy points out, it’s the UNO API that is daunting. BASIC isn’t so bad.

But Villeroy’s advice seems sound. If what you want to do is start to learn how to program against an API, learning C# on the .Net Framework/WinApps or javascript against the Google Sheets API, etc., would offer lots more bang for the buck.

1 Like

StarBasic and its IDE is more like the first appearance of VBA in MS Office 95. MS Office 97 had the complete object orientation, predefined object events, code editor with auto-complete easy-peasy add-in development and all the other gimmicks that do not exist in StarBasic.


Will definitely give that some more consideration.

@joshua4 & @Villeroy Thanks for your insights. I’m probably also gonna download “Clash of the Titans”, to relieve some of my intensity over “squeezing the last drop” from my limited knowledge of the inbuilt functions.

Still learning at least two new things every day - the hard way.