LibreOffice Macro Recorder: Setup and Limits

VBA & macros · Updated November 5, 2026

Yes—LibreOffice includes a built-in macro recorder, but it is limited: it captures some actions in Calc and Writer and turns them into a LibreOffice Basic macro. Enable recording in the options, choose Tools > Macros > Record Macro, perform the steps, and click Stop Recording; expect to review the result because not every action can be recorded reliably.

What the LibreOffice macro recorder does

A macro is a saved set of instructions that can repeat work, such as applying formatting, entering a standard heading, or carrying out a sequence of spreadsheet operations. LibreOffice’s recorder observes supported actions as you perform them and writes corresponding code in LibreOffice Basic. You can then run the recording again or edit its code.

The word “limited” matters. The recorder does not make a complete video-like replay of everything you do, nor does it understand the purpose behind a task. It records supported commands and document operations. Some interface actions, dialogs, or application features may be omitted or translated into code that depends on the current selection and document state. LibreOffice describes macro recording as available in Calc and Writer; it is not a universal recorder for every LibreOffice component.

For a short, repetitive sequence, recording can provide a useful starting point without requiring you to write Basic from scratch. For a complex workflow involving decisions, repeated loops, or changing input, the recording usually needs careful editing—or a macro written with those requirements in mind.

How to enable macro recording

Recording is disabled by default in many installations. In LibreOffice on Windows or Linux, open Tools > Options > LibreOffice > Advanced and select Enable macro recording (limited). Confirm the change. On macOS, open LibreOffice > Preferences and look for the corresponding LibreOffice Advanced setting. Menu wording and placement can vary slightly between releases.

If the setting is already selected but Record Macro is unavailable, check that you are using Calc or Writer and that the relevant document is open. Also check whether your LibreOffice version or installation is managed with restrictions. Enabling the recorder is separate from authorizing a macro to run: the first permits recording, while macro security settings govern whether saved macros can execute.

Record and save a simple macro

Before recording, prepare a small test document or make a copy of the file. Decide what you want to automate and keep the sequence simple. For example, in Calc you might select a range, apply a number format, and add a border. A clean, repeatable sequence is easier to inspect than a recording that includes unrelated clicks and corrections.

  1. Open the document in Calc or Writer and select the starting cell, range, or text that the steps require.
  2. Choose Tools > Macros > Record Macro. If that command is unavailable, verify that recording is enabled in Options.
  3. Perform the actions you want repeated. Avoid exploratory clicks, undo operations, and unrelated edits while recording.
  4. Click Stop Recording on the recording control that appears. LibreOffice opens a dialog for naming and saving the macro.
  5. Give the macro a meaningful name, choose where to save it, and confirm. If you are unsure, save it in the current document so it is associated with that file.

Use a descriptive name such as FormatMonthlyReport, rather than a vague name such as Macro1. Macro names generally should not contain spaces. After saving, locate the recording in the macro list and run it on a copy or sample before relying on it in an important document. A recording may replay selection-dependent actions on a different range than the one you intended.

What it can record—and what it may miss

Commonly recorded tasks are short operations with clear document commands. In Calc, that could mean applying a consistent format to selected cells, setting a border, or repeating a sequence of supported menu commands. In Writer, a recording may help repeat supported editing or formatting operations. The exact coverage depends on the command and LibreOffice version, so a successful recording of one operation does not guarantee that a similar-looking dialog or feature will be captured.

The recorder is not a reliable way to automate every interaction. It may not capture an action at all, may record only part of a dialog-driven operation, or may produce code that refers to the active selection rather than identifying a fixed range. It also does not automatically add logic such as “if this cell is blank, skip it” or “repeat until the last row.” Those are programming requirements, not simply recorded gestures.

A practical test is to stop the recording, inspect it, and run it on a disposable copy with a different selection or a fresh document. If the macro only works when the original cell remains active, it is not yet a reusable solution. Editing the code to identify ranges or handle different starting conditions may be necessary.

Inspecting and editing the generated code

LibreOffice records macros in LibreOffice Basic. To find and manage them, use Tools > Macros > Organize Macros > Basic and choose the appropriate library, module, and macro. The Basic editor lets you examine and change the generated code. The recording is a starting point, not a guarantee that the code will be concise or easy to maintain.

Recorded code can contain calls that dispatch application commands, along with references to the current document, selection, or cursor. This is why a macro can work during its original recording session yet behave differently later. Read the code before changing it, and test each change on a copy. If you need a macro to process many sheets, handle missing values, or respond differently to different inputs, you may need to learn the relevant Basic and LibreOffice API concepts rather than relying on further recording alone.

Keep a note of what the macro is expected to change. That makes it easier to spot accidental edits and to decide whether the recorded steps still match the task after the document layout changes.

Where macros are saved and how to reuse them

When saving a macro, choose between a library associated with the current document and a personal library such as My Macros & Dialogs. A document library is useful when the macro belongs with one particular file and should travel with it. A personal library is more convenient for macros you want available from your own LibreOffice profile across documents, but it is not automatically embedded in every file you share.

To run a saved macro, open Tools > Macros > Run Macro, select its library and module, choose the macro, and click Run. If the macro is stored in a different document, that document or library must be accessible. For a shared workflow, tell recipients where the macro is stored and what document conditions it expects; a macro in your personal library will not necessarily be available on another person’s computer.

Use LibreOffice’s native Open Document Format when preserving a LibreOffice Basic macro is important, and verify the result after saving or converting. LibreOffice Basic macros are not the same as Excel VBA macros. Saving a file in an Excel format may not preserve LibreOffice-specific macro code in a usable form, so keep a separate ODF copy and test compatibility before sharing.

Common problems and practical fixes

  • Record Macro is missing: Enable the limited recorder in the Advanced options, and confirm you are working in Calc or Writer.
  • The recording stops but no useful macro appears: Try a smaller sequence with ordinary, supported document commands. Some actions are not recordable.
  • The macro changes the wrong cells or text: Check the active selection and cursor assumptions. Test with the intended starting point and adjust the code if it must target a specific range.
  • The macro is not listed on another computer: It may be saved in your personal library rather than inside the shared document. Choose an appropriate document library or provide the macro separately.
  • LibreOffice blocks the macro: Review the macro security prompt and the source of the file. Do not lower security settings just to run an untrusted macro.

When diagnosing a failure, change one thing at a time. First confirm that the macro runs in the document where it was saved, then test its assumptions about selection, sheet, and document structure. This helps distinguish a recording limitation from a storage or security issue.

Macro security and safe use

Macros can alter documents and may access or change data, so treat them as executable code rather than harmless formatting. A macro in a file from an unknown sender can be malicious. If a security warning appears, do not enable macros unless you trust the source and have a reason to use the file. When in doubt, ask the sender what the macro does or inspect it before running it.

Macro security settings are available through Tools > Options > LibreOffice > Security, where the Macro Security controls can be opened; on macOS, use LibreOffice Preferences. Prefer a security level and trusted-source arrangement appropriate to your environment rather than enabling all macros globally. For important documents, keep a backup before running an unfamiliar macro, and test new recordings on copies. A recorded macro can make many changes quickly, and undo may not restore every macro operation as expected.

When to use another approach

The recorder is a good first choice when a task is repetitive, short, and composed of supported commands. It is less suitable when the work depends on changing data, conditions, complex navigation, or interaction with other applications. In Calc, formulas and built-in data tools may be easier to audit when the goal is calculation or transformation rather than replaying a sequence of actions.

For more advanced automation, LibreOffice Basic can be edited directly, and LibreOffice also supports automation through its UNO programming interfaces. Those approaches require more technical knowledge but can provide control that a recording cannot. Extensions may also provide an existing feature. Choose the simplest method that remains understandable and maintainable for the people who will use the document.

If your work is specifically in Microsoft Excel, do not assume a LibreOffice recording is interchangeable with Excel’s macro recorder. Excel commonly uses VBA for desktop macros, while LibreOffice Basic uses different APIs and object models. A file conversion does not automatically translate one program’s automation into the other’s.

Frequently Asked Questions

Is the LibreOffice macro recorder built in?
Yes. It is included, but recording is limited and may need to be enabled in Tools > Options > LibreOffice > Advanced.

Can LibreOffice record macros in Calc and Writer?
LibreOffice documents macro recording as available in Calc and Writer. Not every action in either program is supported, and availability can vary with the operation and version.

What language does the recorder use?
It creates LibreOffice Basic code. You can inspect and edit that code with the Basic macro organizer and editor.

Can I use a LibreOffice macro in Excel?
Not automatically. LibreOffice Basic and Excel VBA use different programming environments, and conversion between file formats does not ensure that the macro will work in Excel.

Where should I save a macro I want to share?
Save it in the document’s macro library when it belongs with that file, then test the shared copy. A macro in your personal library is generally tied to your LibreOffice user profile and may not travel with the document.

Related

Try it: the Column Letter to Number: aA is 27, XFD is 16,384. Converts both ways.

More in VBA & macros

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.