Macro Tutorial

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
chuck99
Posts: 14
Joined: Sun Sep 02, 2012 2:19 am

Macro Tutorial

Post by chuck99 »

Are there any Calc macro tutorials? I have created some complicated macros in previous years, but I seem to be completely lost in modifying them now. The macros are in a separate sheet within the file.
OpenOffice 3.4.1 on Win xp pro sp3
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Macro Tutorial

Post by Zizi64 »

Are there any Calc macro tutorials?
Yes, there are.

There are descriptions for the StarBasic, and for the API (Application Programmind Interface).
Start with Andrew Pitonyak's free books. Those books contain many useful informations and a lot of StarBasic + API examples:
http://www.pitonyak.org/oo.php

BasicGuide_OOo3.0.0.pdf:
https://www.google.hu/url?sa=t&rct=j&q= ... Vm2tYfdo0A

API descriptions:
http://www.openoffice.org/api/
http://api.libreoffice.org/


Or: are you using some other supported programming language for the API functions of the Office suite?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Macro Tutorial

Post by Zizi64 »

I have created some complicated macros in previous years, but I seem to be completely lost in modifying them now. The macros are in a separate sheet within the file.
Can you upload that file here?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
keme
Volunteer
Posts: 3699
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Macro Tutorial

Post by keme »

Are your spreadsheets created in OpenOffice Calc?

From my memory - not confirmed by practical tests or info-searches:
Before VBA, Excel had those "worksheet macros", and IIRC there was something similar in Lotus 1-2-3 and/or SuperCalc. AFAIK the "legacy" macros in Excel will still run, but you can't edit them or enter new ones.
Never seen it in OpenOffice Calc. Even with its predecessor "Star Office", the StarBasic was a separate module ; no programming commands were entered within the spreadsheet grid.

"Worksheet macros" use a set of application specific commands, which I believe are not handled by import filters. IOW, they are not portable and none of them will run on Calc. (If my memory serves me right, that is.)
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
esperantisto
Volunteer
Posts: 578
Joined: Mon Oct 08, 2007 1:31 am

Re: Macro Tutorial

Post by esperantisto »

AOO 4.2.0 (of 2015) / LO 7.x / Win 7 / openSUSE Linux Leap 15.4 (64-bit)
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Macro Tutorial

Post by Villeroy »

chuck99 wrote:The macros are in a separate sheet within the file.
Are you referring to Excel 4 macros?

http://spreadsheetpage.com/index.php/si ... questions/

https://support.office.com/en-us/articl ... A010336614
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply