What Is an XLSM File?

The real difference between an Excel workbook and an Excel workbook that may contain executable macro code.

  1. Add a file Choose or drop it here
  2. Pick the format Change it whenever needed
  3. Download the result After conversion completes

The Office 2007 Workbook Type That Signals Possible Code

XLSM is the Excel macro-enabled Office Open XML workbook format introduced with Office 2007. It is closely related to XLSX, but the final m matters: Microsoft says extensions ending in m, including .xlsm, can contain VBA and XLM macros, while the ordinary x suffix cannot. A workbook may contain ordinary sheets, formulas, charts, tables, styles, and external links whether or not it contains a macro. The XLSM extension is an explicit warning that code may also be present. It does not prove a workbook is malicious, and it does not prove that every XLSM actually has useful macros.

This format is common where a workbook needs a button, event action, repeated cleanup step, or a custom calculation written in Excel’s VBA environment. The content that makes it different is not a visible “macro tab.” It is package content that Office recognizes as macro-enabled and, when present, a VBA project part. That is why an XLSM file can look exactly like an XLSX file until it is opened or inspected.


A ZIP Package With XML Parts and a Separate VBA Project

Like XLSX, XLSM is an Open XML package: it normally begins with the ZIP signature PK and holds separate XML parts for workbook settings, sheets, shared strings, styles, drawings, and relationships. Microsoft describes the macro-enabled XML file as having a defined XML schema for the workbook’s data and properties. The macro-enabled content type tells Office that code is allowed in the package. This does not turn XML into a programming language; the VBA project is a separate binary component carried beside the XML workbook parts.

That division explains two important facts. First, changing a filename from .xlsx to .xlsm does not create a macro. It only changes a label, and Office may reject the mismatch. Second, saving a genuine macro workbook as .xlsx removes the VBA project because the target format does not permit it. Data, formulas, and formatting may remain, but code that performed refreshes, checks, or exports is no longer there. Make a separate tested copy when the aim is to remove code.


What the Macro-Enabled Suffix Gives You and What It Demands

  • Permit VBA or XLM: the m suffix identifies a workbook type that may carry code.
  • Keep modern workbook capacity: it uses the XML-era Excel grid, up to 1,048,576 rows and 16,384 columns per sheet.
  • Allow inspection: the extension alerts a recipient to review origin and macro behavior.
  • Trigger security controls: Office may block rather than offer a simple enable button.
  • Lose code when saved as XLSX: ordinary XLSX cannot contain these macros.
  • Require compatibility testing: another spreadsheet app may retain code but not execute it the same way.

The large grid is a modern Excel limit, unlike XLS’s 65,536 rows and 256 columns. It is unrelated to macro capability but helps identify XLSM as an XML-era workbook rather than the old binary XLS format. File size can still be large because XML, drawings, cached values, and embedded objects all count; the macro marker alone does not predict size.


Why a Downloaded XLSM May Be Blocked Even When the Code Is Legitimate

Microsoft 365 Apps blocks macros in Office files from the internet by default. Windows adds Mark of the Web (MOTW) to files obtained from an untrusted location, including browser downloads and email attachments. Microsoft documents that a file with Internet ZoneId 3 is blocked by default, and the newer security message does not offer the old Enable Content button. The behavior is intentional: malicious macro attachments have been a major delivery method for malware.

If the file’s origin is known and organizational policy permits it, Windows Properties has an Unblock option that removes MOTW, and PowerShell has Unblock-File. That is not a universal repair instruction. It changes a security label so macros may run; it should not be used on an unknown attachment. A trusted location or digital signature can be part of an organization’s approved approach, but policy can still block execution.


The Macro Problems That a File Converter Cannot Magically Fix

“Macros are blocked” and “the macro is broken” are different reports. The first commonly comes from MOTW or a non-trusted network location. The second can come from a missing add-in, an unavailable external file, an Excel version difference, or code that assumes a particular Windows path. Removing the internet mark may allow execution but cannot repair an absent dependency. Check the source, workbook references, and the actual VBA error before changing security settings.

LibreOffice Calc can load Microsoft Office files and has some VBA support, but its own documentation says that support is not complete. It can retain original VBA code when saving back to a Microsoft format, yet a macro that works in Excel should be tested in Excel if Excel behavior is required. Recent LibreOffice bug reporting also shows that saving native Basic macros as XLSM can lose them. Do not use cross-application opening as proof that an automation workflow is preserved.


XLSM Facts Compared With a Regular XLSX Workbook

PointXLSMXLSX
PackageOpen XML ZIP packageOpen XML ZIP package
VBA/XLM macrosMay contain themCannot contain them
Extension cluem = macro-enabledx = no macros
Grid1,048,576 × 16,384Same modern grid
Internet downloadMOTW can block macrosNo macro code to run
Save as XLSXRemoves codeKeeps no code

Practical Questions About Macro-Enabled Excel Files

Is every XLSM dangerous?
No. It is a container type that may contain code. Treat unknown code cautiously, but the extension alone is not a verdict.

Can I rename XLSX to XLSM to add macros?
No. Renaming does not create the required macro project or valid package content.

Why is Enable Content missing?
Office may be blocking a Mark-of-the-Web file from the internet rather than showing the older enable option.

Will saving as XLSX keep my automation?
No. Microsoft’s ordinary x formats cannot contain VBA or XLM macros.

Can I open it in LibreOffice?
Often, but its VBA support is incomplete. Test the specific macro and preserve the source copy.

Macro signing answers a different question from the file extension. Microsoft's VBA security guidance explains that unsigned VBA projects cannot be enabled at the highest macro-security level, while a trusted macro developer can be added as a trusted source. A signature can help identify a known publisher and show whether signed code has changed after signing; it does not make every action performed by that code suitable for every recipient. A valid review still needs the expected source, purpose, and dependencies.

Legacy XLM macros are another reason the extension rule matters. They are not the same thing as a modern VBA module, but Microsoft includes both VBA and XLM macros in its explanation of why an ordinary .xlsx file cannot contain code. A workbook may therefore trigger macro handling even when someone cannot find a familiar VBA module in the editor. Do not diagnose the file by appearance alone; confirm the file type and ask the owner which automation, if any, is required.

When an XLSM reports corruption after being processed by a library or a converter, the likely cause is a package that retained the extension without correctly retaining every related macro part. This is why tools that edit workbooks programmatically often have an explicit keep-VBA option, and why the result must be opened in Excel before replacing an original. Check that Excel opens it without a repair prompt, that the expected macro project still exists, and that a non-destructive test action produces the expected result. Never test unknown code by enabling all content simply to see whether it works.

The safest first open for an unfamiliar XLSM is an inspection, not an execution test. Keep macros disabled, read the workbook's stated purpose, and confirm the sender through a separate channel. Look for unexpected requests to enable content, altered file names, or instructions that conflict with normal organizational practice. If the workbook is legitimate, its owner can explain what the macro does and why it is needed. That factual explanation is more valuable than a generic instruction to bypass Office warnings.

If an organization uses a trusted location, that location should be controlled rather than used as a way to make every attachment run. Microsoft's documentation notes that trust and policy settings affect whether macros run. A trusted folder is appropriate only where the organization has decided how files arrive there, who can write them, and how changes are reviewed. Moving an unknown download into that folder defeats the purpose of the warning. The file's origin remains the first fact to verify.