OpenOffice.org's macro language is quick to learn and and easy to use. In a relatively short time even a brand new user can automate many of the tasks that would have otherwise taken up a large amount of time and effort. However, running the macro can still be laborious, with the user always having to do the following:
Fortunately, this can all be done in a single click - by customizing the toolbar; and the aim of this customization is to:
Before the toolbar customization can take place a macro must be created by using the OpenOffice.org Basic IDE (Integrated Development Environment); and at this point the less experienced user might want to pause and read the article "Using Macros to Automate OpenOffice.org Calc". The macro can be as complicated or as simple as is necessary, for example, the following macro loads a random number into a selected cell in a Calc spreadsheet:
Sub RandomNumberToActiveCell
oCell = thisComponent.getCurrentSelection
oCell.Value = int ( 10 * Rnd )
End Sub
If this macro is saved into Module1 in the Standard library in the 'My Macros' area then the user can run it by:
Obviously they'd get very bored if they had to do this often, but fortunately, customizing the toolbar will enable them to do this in a single click.
The process for adding a button for this new macro is quite simple:
A button for the macro will now be displayed on the toolbar; and if the user now selects a cell and presses the new button then a random number will be displayed in the cell as expected. However, anyone looking at this new button will not be impressed at the moment - it works correctly, but the button will just have the word 'RandomNumberToActiveCell' on it.
With the macro itself working the user needs to turn their attention to the look of the button that's just been created - in this case changing the button to an icon. They will need to:
The user will now have the button looking the way that they want; doing the job that they want; at their fingertips all of the time; and any task is now 1 click long instead of 8.