.fw files.wiki
XLSM

XLSM Files

Excel Macro-Enabled Workbook

An .XLSM file is an Office Open XML spreadsheet workbook that can store and run VBA macros in Microsoft Excel.

Microsoft Excel Macro-Enabled Workbook

Developer
Microsoft
Category
Spreadsheets
MIME type
application/vnd.ms-excel.sheet.macroEnabled.12
Format
Container
Magic bytes
50 4B 03 04
First released
2007
Latest version
Office Open XML ISO/IEC 29500, maintained edition; Microsoft 365 Excel implementation
Open standard
Yes

Open a .XLSM file online

Reading file…

What is a .XLSM file?

.XLSM extension refers to a “Microsoft Excel Macro-Enabled Workbook” - a special Office Open XML spreadsheet (ZIP package) created by Microsoft in Excel 2007. .XLSM is the macro-enabled equivalent of .XLSX: both formats describe OOXML workbook, though .XLSM can include VBA project (usually stored as vbaProject.bin), whereas XLSX lacks any macros. The common objects which the workbook contains are worksheets, cells, formulas, table, chart, pivot table, styles, shared strings (if applicable), drawings, workbook metadata, etc.

This type is regularly met within Excel templates used for various purposes including modeling of finances, reports creation, accounting calculations, data entry, business intelligence dashboards, business automation, etc. Xlsm is the standard macro-enabled workbook format in the set of Microsoft office applications, and at the same time supported by some third party tools such as LibreOffice Calc, ONLYOFFICE Docs, Kingsoft Spreadsheets, or Google Sheets with variable macro behavior depending on application.

The alternative consumer use for this extension does not exist - if you have encountered any file in .xlsm format, but which was not a package with OOXML content, it should not be used due to suspicious format, since only files packed using ZIP are valid XLSMs. Valid file will contain ZIP Magic header 50 4B 03 04 (first four byte), and components like [Content_Types].xml and xl/workbook.xml and may display a yellow security bar in Excel due to disabled macros at first use.

How to open a .XLSM file

Open a .XLSM file on Windows

  1. 1 Go to the folder with your file in File Explorer. Usually, downloaded files end up in Downloads.
  2. 2 Double-click your .XLSM file if you have an app for .xlsm files on your computer. In case it does not open, move on to step three.
  3. 3 Right-click your .XLSM file -> select Open with -> Choose another app.
  4. 4 Choose Microsoft Excel in the list (Windows 11: choose Always). For Windows 10 -> put a check on "Always use this app to open .xlsm files" and click OK.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Windows

Open a .XLSM file on macOS

  1. 1 In the Finder app, locate your .XLSM file.
  2. 2 Just double-click your .XLSM file in order to automatically launch the program which is connected with it.
  3. 3 Need another app on your Mac? Control-click the file (or right-click with a mouse). In the pop-up menu select Open With -> Microsoft Excel.
  4. 4 If it isn't in the list, choose Other… and find the application manually.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for macOS

Open a .XLSM file on Linux

  1. 1 Launch your file manager. Depending on the desktop it may be named Files (GNOME), Dolphin (KDE Plasma), Nemo (Cinnamon) or Thunar (Xfce).
  2. 2 Double-click the file.
  3. 3 Or choose another program by right-clicking the file -> Open With -> LibreOffice Calc.
  4. 4 Install LibreOffice Calc (if it is not installed on your computer) from the software centre, repository or Flathub.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Linux

Open a .XLSM file on Android

  1. 1 Launch Files or another file management app.
  2. 2 In Downloads, find the .XLSM file and open it by tapping.
  3. 3 A list of apps capable of opening the file will be shown. Tap Microsoft Excel and press Always to permanently connect the file type with this app.
  4. 4 No apps able to open this file? Download Microsoft Excel from the Google Play Store.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Android

Open a .XLSM file on iPhone / iPad

  1. 1 Use the Files app and go to On My iPhone, iCloud Drive or Downloads.
  2. 2 Tap the .XLSM file you want to open.
  3. 3 If the file can be opened by a built-in iOS app (supported format), it opens automatically.
  4. 4 Touch and hold the file to get the context menu -> choose Share -> select Microsoft Excel from the list of apps.
  5. 5 If there is no such option, download the app first from the App Store and then tap the document again.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for iPhone / iPad

Open a .XLSM file online

  1. 1 Move to the online viewer at the top of this page.
  2. 2 Drag the file there or select it, and its contents will appear in your browser tab. The file is not uploaded.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Online

More details about opening .XLSM files

For Windows, MS Excel should be employed as it possesses a set of functions for editing VBA scripts, using macros, applying Power Query, generating pivot tables and graphs, creating password-protected workbooks and others. The spreadsheet can run as paid desktop software under the Microsoft 365 pack or as a separately licensed Excel. Excel for Mac can process xlsm files and use macros, yet it is unable to handle Windows ActiveX controls and COM automation. Among the programs for opening files in Linux there are LibreOffice Calc, ONLYOFFICE, WPS Office, Calc in Apache OpenOffice, and Gnumeric and Collabora Office.

There exist several mobile applications (e.g., Android and iOS editions of Excel, WPS Office) which open and edit workbooks in xlsm format and Google Sheets for Android as well, although, as usually for mobile apps, they can not run the macros inside. From web applications, Excel for the web, Google Sheets, Zoho Sheet, ONLYOFFICE Docs, iCloud Numbers, and Microsoft 365 viewers allow one to display .xlsm workbooks, although the support of VBA in the web is way worse than in a desktop app.

The best solution to work with a .xlsm files is, obviously, to open it with a desktop Excel. For viewing without macros executing one can try Protected View mode for a downloaded file, viewing or a safe spreadsheet web application without VBA support like Google Sheets & Zoho Sheets (and other).

In case of failure upon double-clicking a file, download some spreadsheet application, reconfigure the file opening by a double click, use Open with function and make sure the file extension was changed from XLS, ZIP, HTML or CSV. In addition, a browser cannot handle rendering OOXML spreadsheets, thus uploading them into a cloud service for sheets is preferable.

Technical details

The .xlsm file format is an Office Open XML-based workbook format that employs a ZIP compression method. The signature of a typical ZIP file starts with 50 4B 03 04. Split packages can have another start but it is still a ZIP container that conforms to some extent of the Open Packaging Conventions specifications including [Content_Types].xml, _rels/.rels, docProps/core.xml, docProps/app.xml, xl/workbook.xml, xl/worksheets/sheetN.xml and xl/_rels/workbook.xml.rels files. In addition, macro support may be indicated by inclusion of xl/vbaProject.bin, a binary VBA project. The family of the formats is named Office Open XML, being first standardized as ECMA-376 in 2006 and later as ISO/IEC 29500. A workbook that has an extension of .xlsm utilizes the macro-enabled workbook content type but not the .xlsx. The officially recognized mime type is application/vnd.ms-excel.sheet.macroEnabled.12.

Workbooks are written in the XML format and are usually encoded using UTF-8 but also could use UTF-16 encoding. Usually XML parts are compressed using ZIP deflate. All of the large repeated text could be saved using xl/sharedStrings.xml. Additionally all of the formatting information is contained by xl/styles.xml part. Additional metadata may be comprised of the creator or the author of the file, companies name, created and modified date/time properties, revision, worksheet names, custom document properties, external data links, calculation options as well as printer or page settings. Files range from tens of kilobytes for simple forms to many megabytes due to containing images and pivottable caches, embedded documents, vba project and other elements. Signature refers always to ZIP container but not to actual type of the spreadsheets. The main difference between .xlsm and the obsolete .xls format is that .xlsm is ZIP package while .xls is BIFF/OLE package.

How to convert .XLSM files

Convert the .xlsm to .xlsx format if the need for VBA disappears or the workbook cannot be passed through a mail gateway, documents portal, or upload wizard due to macros. In the MS Excel, it is more preferable to save the result from File → Save As manually since Excel will take into account the current workbook calculations while saving the file without the use of macros. In the LibreOffice Calc, this action can be done using the command libreoffice --headless --convert-to xlsx --outdir output input.xlsm, though the VBA project will be either removed or not functional in the converted .xlsx workbook.

Save the workbook to the PDF format for further use with invoices and reports creation, archiving files and printing purposes. For this purpose, the following command may be used in LibreOffice libreoffice --headless --convert-to pdf --outdir output input.xlsm This type of converting keeps page layout of workbook intact, yet formulas, filters, hidden logic elements, interactivity elements, and VBA projects will not be stored.

Convert the particular sheet to CSV / TSV format for database processing, scripting languages (such as R or Python) and websites. To export a single sheet, we may use --convert-to csv parameter, yet plain tabular values will be exported.

ODS (Open Document Spreadsheet) should be used as the format for the LibreOffice suite. When we convert the format of workbook, we should check Excel-only functions (formulas, pivot, etc.), and do all needed re-calculations of links. We will retain the original Excel workbook because all VBA projects and elements will be probably lost or damaged after reformatting and converting.

Convert toToolCommand / note
XLSX LibreOffice libreoffice --headless --convert-to xlsx --outdir output input.xlsm Removes or disables VBA macro functionality because .xlsx is the non-macro workbook format.
PDF LibreOffice libreoffice --headless --convert-to pdf --outdir output input.xlsm Produces a fixed-layout document for sharing or printing; formulas and macros are not editable in the PDF.
CSV LibreOffice libreoffice --headless --convert-to csv --outdir output input.xlsm Exports the active or first sheet depending on import/export settings; formatting, formulas, multiple sheets, charts, and macros are lost.
ODS LibreOffice libreoffice --headless --convert-to ods --outdir output input.xlsm Converts to OpenDocument Spreadsheet; VBA compatibility is not guaranteed and Excel-specific features may change.
HTML LibreOffice libreoffice --headless --convert-to html --outdir output input.xlsm Useful for publishing a sheet as a web page; workbook interactivity and macros are not preserved.
XLS Microsoft Excel or LibreOffice libreoffice --headless --convert-to xls --outdir output input.xlsm Converts to the older binary Excel format; rows, columns, formulas, formatting, and macro compatibility may be limited by legacy XLS constraints.

Common problems and fixes

Excel might prohibit the macros with the notice: “Microsoft has blocked macros from running because the source of this file is untrusted.”This usually means that the file has been received from email, a browser download, or any other place on the Internet using Mark-of-the-Web file property. The remedy is to add this source as trusted source by unblocking file right-clicking the file in Windows Properties and selecting Unblock if that checkbox is present or copying this file into one of Trusted Location folders in Trust Center.

The statement, “Excel cannot open the file because the file format or file extension is not valid” suggests that the document could be corrupt or it was incomplete download; alternatively, somebody changed an extension to .xlsm for some file that was not OOXML workbook before the change. Make sure this file is a compressed package with OOXML components, otherwise try recovery from the backup copy if any.

The statement: “We found a problem with some content”, implies, that this content might include invalid XML part(s), broken relationship(s), invalid formula(s) and drawing(s). Let Excel repair the file; save corrected file, make comparison of its content against original if possible.

If the file opens properly but the macros don’t start working then check Protected View, Excel Web /Excel Mobile application usage; presence of extension .xlsx in the list of file properties, or a group policy prohibits the VBA use, or this workbook contains a Digital Signature of an untrusted publisher.

A missing fonts, turned off Excel add-ins, no access to external sources of the data, lack of ActiveX elements support in the non-Windows version will result in the workbook sheet looking wrong, or button doesn’t execute macros attached. Extremely large Excel workbooks (especially with macros) usually open very slow because of large used range, huge caches of pivot tables, pictures, conditional formattings, lots of volatile formulae and too many VBA modules. Password protection, Excel file encryption will let access the workbook only in case of entering correct password. There is no reliable legitimate bypass for modern Excel encryption. Make sure you turn ON the automatic calculation and links refreshing.

Security considerations

.XLSM is a risky file format as these documents include possible code in the form of an executable VBA macro that runs within the Microsoft Excel environment if macros are allowed. Phishing operations employ malicious files that use the macro to download some kind of malware, use PowerShell/Shell command for execution or steal sensitive information or abuse legitimate capabilities of the MS Office platform automations. The latest editions of MS Office use protection known as “Mark of the Web” on the file which means that the file is downloaded on the Internet from an untrusted source, and thus, the macros might be disabled by the program in favor of protection. Do not enable macros in an untrusted workbook.

Digital signatures identify the signers of the document and whether there were any changes in content; however, signing does not certify any security or safety of the macro itself. Additionally, such format will expose hidden sheet names, cells content that includes formulas, comments, external links, connection strings and personally identifiable data. Before sending any .XLSM files use Excel’s Document Inspector to get rid of all unwanted links or objects within the file and even export it into .XLSX or into PDF.

History and versions

.xlsm has been introduced in Excel 2007 as part of moving away from legacy binary formats .xls towards new OpenXML-based .xlsx by Microsoft to distinguish between macro-enabled workbooks (having ".xlsm" extension) and regular ones, in both terms of the document representation itself and filtering by file type by any software component. Office Open XML format is published as ECMA-376 in 2006 and then adopted internationally under ISO/IEC 29500 since 2008; subsequent versions update and refine package description as well as data representation itself within packages. Excel 2010, 2013, 2016, 2019, 2021, 2024, and Microsoft 365 have kept .xlsm as primary format capable of running VBA scripts. This evolution allowed to retain legacy VBA-based automated functionality in Excel, while representing sheets themselves within more easily distributable and restoreable XML-compressed parts compared to previous proprietary binary files. Various measures for enhancing macro safety had been taken ever since including introduction of Protected View, trusted locations, digital signature for macros, corporate level policy settings, and default disabling for most macro scripts available for download from internet. Nowadays there are other possible alternatives including Office Scripts and Flow, PowerAutomate, Python in Excel and JS-based add-ins. While it remains quite commonly used in business context, .xlsm format remains formally described only up to package and markup description layer with additional details provided within MS Office and MS Excel product documentation.

.XLSX indicates the non-macro OOXML workbook file. Use it if the VBA programming is no necessary to be run by user and if the email server, document management system, and any security restrictions block macro files. .XLSB indicates Excel Binary Workbook which may contain macros. Such file format allows opening the spreadsheet very quickly if there are lots of cells and it may be smaller in size but unlike XML structure, .XLSB's binary structure is less transparent. .XLS file format denotes old binary workbook file. It allows macros to use and complies to restrictions typical for earlier spreadsheets formats like 65,536 rows. .XLAM denotes Excel Macro-Enabled Add-In used to store macros, functions, customization etc., not data. .XLTm file indicates a macro-enabled workbook template for creating new .xlsm files. .ODS file indicates that workbook is created using open document and it is compatible with LibreOffice and other ODF applications. Excel VBA may not be preserved in this file correctly. .CSV, TSV, and PDF do not allow usage of macros and should include simple table data without formulas.

Comments (0)

Replying to

No comments yet. Be the first to share your experience with this file type.