Macros in OpenOffice Calc - a tutorial
Macros are very popular when it comes to automating program sequences. In this article you will learn how to create macros in the spreadsheet OpenOffice Calc.
OpenOffice Calc: the macro recorder
"OpenOffice" is a free and equal alternative to Microsoft Office. Similar to Excel, you can also create OpenOffice Calc macros in the spreadsheet. You can either record macros or you can program them. For the latter, you need a basic knowledge of the OpenOffice.org Basic programming language.
- Start recording: To start recording a macro, go to "Tools" -> "Macros" -> "Record Macro" in the menu bar. The program now logs your activities in the background. Next, do the step you want to automate. For example, you can create a chart with empty values. If you enter values in the table in a later step and run the macro, it will be filled in automatically. When you are finished recording, click "Stop Recording". Then you only have to give the macro a name and save it.
- Execute macro: You need "Java Runtime Environment" to execute a macro. If this is not installed on your PC, you will receive a message from OpenOffice. For security reasons, make sure that the current version is installed. To run a recorded macro, go to "Tools" -> "Macros" -> "Run Macro ..." in the menu bar.
- Add symbol: If you want to access your macro directly using a symbol, click on a gray arrow in the toolbar and then on "Customize toolbar ...". With "Add ..." you can place new elements on your toolbar. The last entry in the "Area" field contains the macros. Use the arrows to determine the position of the macro.
OpenOffice Calc: program macro
If you are familiar with programming, you can also create a macro yourself. OpenOffice has its own development environment. Detailed instructions can be found on the manufacturer's wiki page.
- The basic structure: You can see what the basic structure looks like from a recorded macro. To do this, go to "Tools" -> "Macros" -> "Manage Macros" -> "OpenOffice Basic ..." in the menu bar. Select your macro and click on "Edit ...". You can now write your own source code in the development environment (IDE).
Another practical tip shows you how to protect an OpenOffice document with a password.