Need to process documents in Microsoft Office format with LibreOffice? The file formats of the two office suites are perfectly compatible. And a few settings are enough to simplify exchanges.
Despite its detractors – and the defenders of free software – Microsoft Office is still very widely used in the world to produce office documents (texts, tables, presentations, etc.). Obviously, this does not prevent the use of other office suites – notably LibreOffice – for this type of work. But then arises the thorny question of file compatibility – and, in general, of what is called “interoperability” of tools.
LibreOffice has long been able to read and modify documents generated by Microsoft Office and its main applications (the word processor Word, the spreadsheet Excel and the presentation tool PowerPoint). But for everything to work perfectly and for document exchanges to go smoothly, it is important to fully understand the file formats used by the two office suites and to make a few settings in LibreOffice.
DOCX, XLSX, PPTX, ODT, ODS, ODP: what are Office and LibreOffice document formats?
First of all, remember that computer file formats are recognized by their extension, i.e. by the suffix of the form .X Y Z attached to their name (.txt for a text, .mp3 for an audio file encoded in MP3, .jpg for an image compressed in Jpeg, etc.). Depending on the settings made in your operating system, these extensions are visible or hidden, but they are always present.
From the first versions of Office, Microsoft used file formats that have become de facto standards in the world of office automation: .doc (or DOC) for Word documents, .xls (or XLS) for workbooks and Excel tables, .ppt (or PPT) for PowerPoint presentations, etc.
LibreOffice uses the ODF (Open Document Format, ISO/IEC 26300 standard) document format by default. An open standard, also managed by Microsoft since Office 2007 SP2. ODF files are identified by their extensions: ODT (text), ODS (workbook), ODP (presentation), etc.
Microsoft has also created an open document format, OOXML (Office Open XML, ISO/IEC 2950), in response to ODF and in order to silence criticism of the proprietary formats used by Office (DOC, XLS, PPT…). OOXML is managed since Microsoft Office 2007 and fully recognized by LibreOffice 7.0. Files in OOXML format are recognized by their extensions, an X following the traditional extension: DOCX (text), XLSX (workbook), PPTX (presentation), etc.
Please note, if you are using a recent version of Microsoft Office or LibreOffice, OOXML files generated by Office 2007 and 2010 will open in compatible mode because these older Microsoft office suites only support a subset of the OOXML format. To exchange documents with these versions of Office, it is better to use other document formats (DOC, XLS and PPT), OOXML or ODF not being supported. Please note that certain functions or layout options may not be taken into account when saving a document in an old format. The use of DOC, XLS and PPT should therefore be an exception and not a rule.
During its installation, Microsoft Office asks which format to use by default between OOXML or ODF. Users can thus choose the standardized format recommended by their organization. LibreOffice 7.0 generates ODF files by default, but this choice can be changed after installation. You can choose to save your LibreOffice files in the Microsoft Office format by default.
To do this, open a LibreOffice module (for example, Writer or Calc), go to the menu Toolsthen in Options…
To change the word processor’s default file format, choose Document in the drop-down list Document type.
Then opt for Word 2007-365 (*.docx) in the drop-down list Always save as.
To change the default spreadsheet document format, select binder in the list Document typethen choose Excel 2007-365 (*.xlsx) in the drop-down list Always save as.
Similarly, to change the presentation tool’s default document format, choose Presentation in the drop-down list Document type and then click on PowerPoint 2007-365 (*.pptx) in the drop-down list Always save as.
Validate all your settings by clicking on okay.
LibreOffice will now save all new documents in OOXML by automatically generating .docx, .xlsx and .pptx files.
Note that it is always possible to occasionally choose another format when saving, via the command Save as… from the menu File. To do this, open the drop-down list Kindto select the desired file format.
Macros are sequences of commands used to automate certain processes. For this, they rely on one or more programming languages. LibreOffice knows how to handle macros written in Basic, Python, JavaScript and BeanShell. Microsoft Office macros can be created from any language on the .NET platform, but in practice VBA (Visual Basic for Applications) is still widely used.
Macro compatibility is not guaranteed between the two solutions. Some simple VBA macros can work in LibreOffice, some can’t. And it’s the same for complex macros! This problem is quite old, and, in practice, there is no absolute rule: you have to test! However, to avoid confusion and malfunctions, LibreOffice offers settings to preserve VBA macros in the document, whether they work or not. Thus, if you modify an Office document with macros in LibreOffice, you will be sure that the original macros will be preserved and that they will still work when you send the modified file to a correspondent or a colleague who works with Microsoft Office.
To make this setting, open a LibreOffice module (for example, Writer or Calc), click on the menu Toolsselect Options… and go to the section Loading/savingsection VBA properties.
Load Basic code loads VBA macros, while Executable code will try to throw them.
Save the original Basic code ensures that the VBA macros present in a document will be preserved during the recording phase.
For optimal efficiency, ensure that all the boxes are checked, then click on okay.
If you are several people working on the same documents, for example within a corporate network, it may happen that Microsoft Office warns you that someone else is modifying the file you are trying to open. You can then consult the document in read-only mode, but not modify it: this is a security measure that avoids version conflicts. An invisible lock file (Microsoft Office) is indeed created in order to signal that the file is already being edited. LibreOffice offers its own protection mechanisms, but it can also be configured to create MSO lock files.
To do this, launch a LibreOffice module (Writer or Calc, for example), go to the menu Toolsthen click Options…
Then go to the section Loading/savingin the section Microsoft Office.
Check the box Create an MSO lock file.
Click on okay.
- Note again that the Microsoft Office section also allows you to set the correspondences between Office objects and LibreOffice objects: Word → Writer; Excel → Calc; PowerPoint → Print; but also Visio → Draw and MathType → Math. These options should not be changed. However, you will notice that it is possible to convert SmartArt shapes to LibreOffice shapes. An option that is not activated by default, the quality of conversion being often uneven.