.XLM

XLM File

Excel 4.0 Macro Sheet
Ask a question
QUICK ANSWER

An XLM file is an Excel 4.0 macro sheet - Microsoft's pre-VBA macro language from 1992. Excel opens it with macros blocked by default. Any unexpected XLM file should be treated as potentially malicious: Excel 4.0 macros are a documented malware delivery technique.

Developer: Microsoft Category: Executable Files MIME: application/vnd.ms-excel
OPENS ON Windows macOS Linux
Related: .APK · .EXE · .VBS · .JAR

On this page

19k+ extensions indexed
Last reviewed Jul 10, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the XLM file format?

.xlm is a legacy Excel macro sheet introduced with Microsoft Excel 4.0 in 1992. It stores spreadsheet-style macro programs written in the XLM macro language - a formula-based scripting system that predates Visual Basic for Applications (VBA) by one Excel generation. Each macro function occupies a worksheet cell, making macros visible as a grid of instructions rather than a separate code module.

Internally, .xlm files use the OLE2 Compound File Binary (CFBF) container, sharing the classic D0 CF 11 E0 magic-byte header with .xls, .doc, and .ppt files. The macro data lives inside a BIFF stream flagged as a macro sheet; no unique magic number distinguishes .xlm from a plain workbook, so identification depends on that internal stream flag.

VBA replaced XLM in Excel 5.0 (1993), and the format has been frozen ever since. Microsoft still supports XLM execution for backward compatibility, but blocked XLM macros by default in Excel beginning in 2021 following a wave of malware campaigns (approximately 2018-2020) that weaponized the format to evade defenses tuned specifically for VBA.

Today, XLM payloads appear more often embedded inside .xlsm or .xlsb workbooks than as standalone .xlm files. A malicious sheet can invoke Excel built-in macro functions such as EXEC and CALL to run arbitrary system commands without triggering VBA-focused scanners. Open an .xlm file only from a fully trusted source.

Security & safety

RISK: HIGH

Excel 4.0 (XLM) macros are a well-documented malware delivery vector. Because they predate VBA, they were used 2018-2021 to evade antivirus and drop banking trojans and ransomware loaders, typically auto-running via an Auto_Open macro the moment the workbook opens. Rules for users: never enable macros in an .xlm (or macro-laden .xls/.xlsm) you didn't expect; keep Excel's Trust Center set to block Excel 4.0 macros (default in current Excel since 2021); open suspicious files in Protected View or an isolated VM; analysts can use oletools (olevba) and XLMMacroDeobfuscator to extract the macro code without executing it. A loose .xlm arriving by email/chat should be treated as hostile until proven otherwise.

Format details

in a nutshell
FULL NAMEExcel 4.0 Macro Sheetaka XLM macro file, Excel 4 macro sheet
DEVELOPERMicrosoftsince 1992 (Excel 4.0 macro language, .xlm macro-sheet files)
MIME TYPEapplication/vnd.ms-excel
TYPELegacy Excel macro sheet - pre-VBA macro language stored in a BIFF (OLE2/CFBF) workbook
MAGIC BYTES · FILE SIGNATURE
OFFSET
0001020304050607
HEX
D0CF11E0A1B11AE1
ASCII
········
A standalone .xlm is a BIFF workbook inside an OLE2/Compound File container, so it shares the classic "D0 CF 11 E0" signature with .xls/.doc/.ppt. The macro sheet is distinguished by an internal BIFF stream flagged as a macro sheet, not by a unique magic number. Modern XLM payloads more often live inside .xls/.xlsm/.xlsb files rather than a separate .xlm.

Programs that open XLM files

Windows2 apps
Microsoft Excel Paid Open in Excel (macros stay disabled by default). Use File > Open and review in Protected View before enabling anything.
LibreOffice Calc Open-source Open the .xlm to read the sheet contents; LibreOffice has limited XLM macro execution, which is safer for inspection.
macOS2 apps
Microsoft Excel Paid Open with Excel for Mac; macros are disabled by default.
LibreOffice Calc Open-source Open to view the cells without running the macros.
Linux1 app
LibreOffice Calc Open-source Open the .xlm to inspect macro-sheet cells; combine with oletools (olevba/XLMMacroDeobfuscator) for analysis.

Technical details

deep spec
Container formatOLE2 Compound File Binary Format (CFBF)
Internal stream formatBIFF (Binary Interchange File Format) records inside a 'Workbook'/'Book' stream
Byte orderLittle-endian
EncodingBinary (BIFF records)
Magic bytesD0 CF 11 E0 A1 B1 1A E1 at offset 0 (shared OLE2/CFBF header)
MIME typeapplication/vnd.ms-excel
Macro languageExcel 4.0 XLM - formula-based, cell-resident; each macro instruction is a worksheet cell value
Security classificationHigh risk - XLM macro execution blocked by default in Microsoft Excel since 2021
Notable dangerous functionsEXEC, CALL, REGISTER, RUN - can invoke arbitrary OS commands from within the macro sheet
DeveloperMicrosoft
Superseded byVBA macros (.xlsm / .xlsb workbooks), introduced in Excel 5.0 (1993)
Supported platformsWindows (all modern Excel), macOS (Excel for Mac); read support in LibreOffice Calc
Typical file sizeA few KB to a few hundred KB
CompressionNone - BIFF records are stored uncompressed
Encryption supportOptional; password-protected workbooks may use RC4 or AES encryption around the OLE2 container
Macro execution modelMacros stored as cell formulas in a dedicated macro sheet tab; evaluated top-to-bottom by the Excel calculation engine
Released1992 (Excel 4.0 macro language, .xlm macro-sheet files)
Latest versionExcel 4.0 macro language (frozen 1992); never updated - superseded by VBA in Excel 5.0 (1993)
Specificationlearn.microsoft.com

XLM conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with XLM files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about XLM files.

Frequently asked questions

What is an .xlm file?
It is an Excel 4.0 macro sheet - Microsoft's pre-VBA macro language from 1992. It can contain automation code that runs inside Excel, and is often abused by malware.
Is it safe to open an XLM file?
Opening to view is generally safe if macros stay disabled (the default). Enabling the macros is risky: Excel 4.0 macros are a common malware technique. Only enable code you fully trust.
How do I open an .xlm file?
Microsoft Excel opens it (with macros disabled by default). LibreOffice Calc can also display the cells, which is a safer way to inspect an untrusted file.
What's the difference between XLM and VBA macros?
XLM (Excel 4.0) macros live in cells of a macro sheet; VBA (since Excel 5.0, 1993) is the modern macro language in a separate code editor. New automation should use VBA in .xlsm files.
Why does my .xlm not run its macros?
Current Excel blocks Excel 4.0 macros by default for security. You'd have to allow them in Trust Center settings - do this only for files you trust.
How do I convert XLM macros to VBA?
There's no automatic converter - the logic must be rewritten in VBA (or Office Scripts). Open the .xlm in Excel, read the macro functions, and reimplement them in a .xlsm workbook.

References

1Microsoft Learn - [MS-XLS] Excel Binary File Format speclearn.microsoft.com
2Microsoft Tech Community - Excel 4.0 (XLM) macros blockingtechcommunity.microsoft.com

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.BINCD/DVD Disc Image (BIN/CUE)
4.PARTPartial Download File
5.DATProgram Data File (generic)
6.EXEWindows Executable (Portable Executable)
7.NOMEDIAAndroid No-Media Marker File
8.RPMSGRestricted Permission Message
9.TMPTemporary File
10.TXTPlain Text File

Related extensions

.APKAndroid Package
.EXEWindows Executable (Portable Executable)
.VBSVBScript file (Visual Basic Script)
.JARJava Archive
.EX4MetaTrader 4 Compiled Program (Expert Advisor / Indicator / Script)
.APPXMicrosoft Windows App Package (AppX)

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z