What is the XLTM file format?
An .xltm file is a Microsoft Excel macro-enabled workbook template - the VBA-carrying counterpart of the standard .xltx template. Like all modern Office formats introduced with Office 2007, it is a ZIP archive containing XML parts organized under the Open Packaging Conventions (OPC) specification.
What sets .xltm apart from .xltx is the inclusion of vbaProject.bin, an OLE2 Compound File Binary embedded inside the ZIP. This binary stores all VBA macro source code and compiled bytecode, using the same internal structure as the legacy .xls format. Without it, Excel will not permit the macros to run.
When a user opens an .xltm file, Excel creates a new unnamed .xlsm workbook based on the template - the .xltm itself is never modified. This makes the format well-suited for distributing pre-built spreadsheets with built-in automation: invoice generators, report builders, or data-entry forms with button-driven macros.
The file is identified by the ZIP magic bytes PK (hex 50 4B) at offset zero, identical to .xlsx, .xlsm, and .docx. The actual content type is determined from [Content_Types].xml inside the archive, which declares spreadsheetml.template.macroenabled and confirms the presence of vbaProject.bin.
Each worksheet supports up to 1,048,576 rows and 16,384 columns. When password-protected, encryption uses AES-128 or AES-256 (OOXML Agile Encryption). LibreOffice Calc can open .xltm files, but VBA macro execution is limited; Microsoft Excel is required for full fidelity.
Security & safety
RISK: HIGHXLTM files contain VBA macros and carry the same risk as XLSM. A malicious XLTM can run arbitrary code on the host PC when macros are enabled. Excel's Protected View and macro-security Trust Center warnings apply - leave them enabled. Never enable macros in an XLTM received unexpectedly by email. If you only need the data, open in Google Sheets or LibreOffice Calc, which do not execute Excel VBA. Microsoft 365 blocks macros from internet-sourced files by default since 2022 (requires explicit unblocking).
Format details
in a nutshellPrograms that open XLTM files
Technical details
deep spec| Container format | ZIP archive (OPC - Open Packaging Conventions) |
| MIME type | application/vnd.ms-excel.template.macroEnabled.12 |
| Magic bytes | 50 4B 03 04 (ZIP local file header; identical to .xlsx, .xlsm, .docx) |
| Type identification | [Content_Types].xml inside the ZIP declares spreadsheetml.template.macroenabled; presence of vbaProject.bin confirms macros |
| VBA storage | vbaProject.bin - OLE2 Compound File Binary embedded as a ZIP entry |
| XML encoding | UTF-8 for all XML parts; vbaProject.bin is binary OLE2 |
| Compression | DEFLATE (per-entry ZIP compression) |
| Worksheet capacity | 1,048,576 rows × 16,384 columns per sheet |
| Standard conformance | ECMA-376 / ISO/IEC 29500 Transitional (Strict conformance not used for macro-enabled files) |
| Encryption | AES-128 or AES-256 via OOXML Agile Encryption when password-protected; none otherwise |
| Template behavior | Opening creates a new unnamed .xlsm workbook; the .xltm file itself is never modified |
| Typical file size | 20 KB - 20 MB (varies with embedded VBA code, styles, charts, and images) |
| Released | 2007 (Microsoft Office 2007, Excel 12.0); ECMA-376 (2006) / ISO/IEC 29500 (2008) |
| Latest version | ECMA-376 5th edition (2021) / ISO/IEC 29500:2016 |
| Open standard | Yes · royalty-free |
| Specification | ecma-international.org |
XLTM conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about XLTM files.