Macros dans OpenOffice Calc - un tutoriel
Les macros sont très populaires lorsqu'il s'agit d'automatiser des séquences de programmes. Dans cet article, vous apprendrez à créer des macros dans la feuille de calcul OpenOffice Calc.
OpenOffice Calc: l'enregistreur de macros
"OpenOffice" est une alternative gratuite et égale à Microsoft Office. Semblable à Excel, vous pouvez également créer des macros OpenOffice Calc dans la feuille de calcul. Vous pouvez soit enregistrer des macros, soit les programmer. Pour ce dernier, vous avez besoin d'une connaissance de base du langage de programmation de base d'OpenOffice.org.
- Démarrer l'enregistrement: Pour commencer à enregistrer une macro, allez dans "Outils" -> "Macros" -> "Enregistrer la macro" dans la barre de menus. Le programme enregistre maintenant vos activités en arrière-plan. Ensuite, effectuez l'étape que vous souhaitez automatiser. Par exemple, vous pouvez créer un graphique avec des valeurs vides. Si vous entrez des valeurs dans le tableau à une étape ultérieure et exécutez la macro, elle sera remplie automatiquement. Lorsque vous avez terminé l'enregistrement, cliquez sur "Arrêter l'enregistrement". Il vous suffit ensuite de donner un nom à la macro et de l'enregistrer.
- Exécuter une macro: vous avez besoin de "Java Runtime Environment" pour exécuter une macro. Si ce n'est pas installé sur votre PC, vous recevrez un message d'OpenOffice. Pour des raisons de sécurité, assurez-vous que la version actuelle est installée. Pour exécuter une macro enregistrée, allez dans "Outils" -> "Macros" -> "Exécuter la macro ..." dans la barre de menu.
- Ajouter un symbole: Si vous souhaitez accéder directement à votre macro à l'aide d'un symbole, cliquez sur une flèche grise dans la barre d'outils puis sur "Personnaliser la barre d'outils ...". Avec "Ajouter ...", vous pouvez placer de nouveaux éléments sur votre barre d'outils. La dernière entrée du champ "Zone" contient les macros. Utilisez les flèches pour déterminer la position de la macro.
OpenOffice Calc: macro de programme
Si vous connaissez la programmation, vous pouvez également créer une macro vous-même. OpenOffice a son propre environnement de développement. Des instructions détaillées peuvent être trouvées sur la page wiki du fabricant.
- La structure de base: vous pouvez voir à quoi ressemble la structure de base à partir d'une macro enregistrée. Pour ce faire, allez dans "Outils" -> "Macros" -> "Gérer les macros" -> "OpenOffice Basic ..." dans la barre de menus. Sélectionnez votre macro et cliquez sur "Modifier ...". Vous pouvez maintenant écrire votre propre code source dans l'environnement de développement (IDE).
Une autre astuce pratique vous montre comment protéger un document OpenOffice avec un mot de passe.