A Theoretical Question on Creating Macros from Spreadsheet

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
sokolowitzky
Posts: 103
Joined: Mon Sep 15, 2014 7:34 pm

A Theoretical Question on Creating Macros from Spreadsheet

Post by sokolowitzky »

I have an idea on my mind, although it might not be very productive. I'm not sure if it's sucha a bad idea to try it out.

Sometimes, when I'm making macros, I forget to add explanations or accidentally delete the macros I wrote before. Sometimes I forget useful methods I devised formerly, and I have to rewrite a bunch of codes.
This has made me think about finding a way to create macros on a spreadsheet without using the "IDE" as much as possible. This approach could involve using custom spreadsheet formulas and/or buttons that are linked to basic debugger running in the background, using macros covering all the equivalent commands of "oobasic."

The idea would be to create a process where every time I try to pick a code, it's recorded, and at the same time, the needed code for making the macro is automatically added behind the scenes. Basically, it means, instead of writing, clicking buttons to add new oobasic commands, while doing this, keeping a record of each action in the background.


I know that this method might not follow all the usual coder understanding, but it's important to recognize that it could speed up how I write code and help me remember past ideas. Do you think it's worth trying out?
Last edited by sokolowitzky on Sun Aug 27, 2023 2:21 am, edited 5 times in total.
Win10-OpenOffice 4.1/LibreOffice 7.4
JeJe
Volunteer
Posts: 3127
Joined: Wed Mar 09, 2016 2:40 pm

Re: A Theoretical Question on Creating Macros from Spreadsheet

Post by JeJe »

I'm not understanding your post beyond where you talk about including descriptions in your code.

Do you use the Basic IDE Tools extension which is an example of how you can open module code (so long as its less than maximum string length), and modify it as easily as you can any other string. Add/removing ' marks is particularly useful but there's also inserting Select Case statements and so on.

https://extensions.openoffice.org/en/pr ... -ide-tools
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
sokolowitzky
Posts: 103
Joined: Mon Sep 15, 2014 7:34 pm

Re: A Theoretical Question on Creating Macros from Spreadsheet

Post by sokolowitzky »

JeJe wrote: Fri Aug 25, 2023 6:56 pm I'm not understanding your post beyond where you talk about including descriptions in your code
I'm sorry, I was trying to explain the idea more accurately, but it seems I didn't succeed.
Anyway, I've rephrased my question.
What I meant was, it's like blending a macro recorder, an MRI tool, and the function wizard and some more altogether.
The main idea is to use the keyboard less when we can, without losing any skill or efficiency.
Basically, I want to be able to try out a lot of different codes really quickly, and keep track of what I've tried without using the keyboard too much.
Win10-OpenOffice 4.1/LibreOffice 7.4
JeJe
Volunteer
Posts: 3127
Joined: Wed Mar 09, 2016 2:40 pm

Re: A Theoretical Question on Creating Macros from Spreadsheet

Post by JeJe »

Do you mean autocomplete? OO doesn't have it at all but in LibreOffice there's,

Tools menu/Options/Basic IDE from the listbox\tick Enable code Completion
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Post Reply