XLSM vs XLSX: What's the Difference?
(And Why It Matters for Macros)
You've seen both file extensions sitting in folders. They look the same. They open in Excel the same way. But the moment macros are involved, XLSM and XLSX are completely different formats — and mixing them up will silently delete weeks of VBA code.
This guide explains the technical distinction between the two formats, when each one is appropriate, and exactly what happens when converters handle them incorrectly.
vbaProject.bin inside the ZIP that holds all your macro code. Converting from XLSM → XLSX will always destroy macros. There is no exception.
The Technical Difference
Both XLSX and XLSM are Open XML formats — ZIP archives with XML files inside. You can rename either to .zip and extract it to see the raw structure. But the contents differ in two critical places:
| Feature | XLSX | XLSM |
|---|---|---|
| File format base | Open XML (ZIP) | Open XML (ZIP) |
| Can store VBA macros | No — stripped on save | Yes — vbaProject.bin |
| Can store UserForms | No | Yes |
| Can store VBA class modules | No | Yes |
| Can store Excel 4 macros (XLM) | No | Yes (legacy) |
| Typical file size (same data) | Smaller | Larger by ~10-50KB |
| Security warning on open | None | "Enable Content" prompt |
| SharePoint/OneDrive compatible | Full support | Limited (macros blocked) |
| Google Sheets import | Native | Opens, macros lost |
What's Inside Each ZIP Archive
Rename any Excel file to .zip and extract it. Here's what you'll find:
XLSX structure (no macros possible):
workbook.xlsx/
├── [Content_Types].xml ← no vba entry
├── _rels/
├── xl/
│ ├── workbook.xml
│ ├── worksheets/
│ ├── styles.xml
│ └── sharedStrings.xml
└── docProps/
XLSM structure (macros live here):
workbook.xlsm/
├── [Content_Types].xml ← includes vbaProject entry
├── _rels/
├── xl/
│ ├── workbook.xml
│ ├── worksheets/
│ ├── styles.xml
│ ├── sharedStrings.xml
│ └── vbaProject.bin ← ALL your VBA code is here
└── docProps/
The vbaProject.bin file is a Compound Document Binary Format blob that stores the entire VBA project — every module, every class, every UserForm. When a converter saves as XLSX, it simply omits this file and removes the reference from [Content_Types].xml. The macros don't transform or migrate — they vanish.
.xlsx to .xlsm does NOT create a valid XLSM file. The internal [Content_Types].xml still declares it as XLSX. Excel will open it but will not allow macro execution. You must use File → Save As → Excel Macro-Enabled Workbook to create a proper XLSM.
When Online Converters Destroy Your Macros
This is where the real damage happens. Tools like CloudConvert, Zamzar, iLovePDF, and Smallpdf all perform server-side conversions using LibreOffice or similar engines. When they convert XLSM files, the pipeline does one of two things:
- Export to target format, drop vbaProject.bin — the macro code is silently deleted with no warning
- Re-encode as XLSX internally but keep the .xlsm extension — the file looks like XLSM but the macros are gone; Excel opens it without error and you discover the loss hours later
Neither scenario gives you an error. Neither scenario gives you a warning. You get a clean file back with zero VBA code inside.
The Four Excel Macro Formats Compared
XLSM isn't the only macro-capable format. Here's how all four relate:
| Format | Macros? | Year introduced | Best for |
|---|---|---|---|
| .xlsm | Yes (VBA) | 2007 | Modern workbooks with VBA — the default macro format |
| .xlsb | Yes (VBA) | 2007 | Large files (50MB+) — binary format, 30-70% smaller, same VBA support |
| .xls | Yes (VBA + XLM) | 1997 | Legacy compatibility only — avoid for new workbooks |
| .xlsx | No | 2007 | Sharing, collaboration, Google Sheets, no-macro workbooks |
When to Use Each Format
Use XLSX when:
- Your workbook has zero VBA code
- You're sharing with people who may flag macro warnings as security risks
- You're uploading to SharePoint, Teams, or OneDrive for co-authoring
- You're importing into Google Sheets
- You want the smallest possible file size
Use XLSM when:
- The workbook requires VBA modules, event handlers, or UserForms to function
- You're distributing to users who will enable macros in a controlled environment
- You're building tools for internal use within an organisation
- You need to preserve macro code between sessions
Use XLSB when:
- The workbook is very large (>10MB) and open/save performance matters
- You don't need to inspect the raw XML (forensic auditing, version control)
- You still need full VBA support but want the binary format's speed advantage
Converting XLSM → XLSX Safely (Without Macro Loss)
If you need to share an XLSM file with someone who can't enable macros, the safe workflow is:
- Export VBA modules first. In the VBA editor (Alt+F11), right-click each module → Export File. Save as
.bas(standard modules),.cls(class modules), or.frm(UserForms). - Create a macro-free copy. File → Save As → Excel Workbook (.xlsx). This is your sharing copy — no macros, fully compatible.
- Keep the XLSM original. Never overwrite it. The XLSX is a derived artefact, not the master.
- Document what's lost. Add a README worksheet to the XLSX noting which functionality requires macros and where to find the XLSM original.
How to Check if a File Has Macros Before Converting
Before you hand a file to any converter, check whether it contains VBA code:
Option 1 — In Excel: Alt+F11 opens the VBA editor. If the Project Explorer shows modules with code, macros are present.
Option 2 — Free browser tool: Drop the file into the XLSM Macro Inspector — it reads the ZIP structure client-side and lists every VBA module name and line count before you convert anything. No upload required.
Option 3 — Command line (Windows PowerShell):
Add-Type -Assembly System.IO.Compression.FileSystem
$zip = [System.IO.Compression.ZipFile]::OpenRead("workbook.xlsm")
$hasMacros = $zip.Entries | Where-Object { $_.Name -eq "vbaProject.bin" }
if ($hasMacros) { "Has macros" } else { "No macros found" }
$zip.Dispose()
Summary: The Critical Difference
| Question | Answer |
|---|---|
| Can XLSX store VBA? | Never |
| Is XLSM just XLSX with a different extension? | No — different internal structure |
| Do converters warn you when macros are stripped? | Almost never |
| Can you recover macros after XLSM→XLSX conversion? | Not without a backup |
| Is there a safe way to convert XLSM without losing macros? | Yes — export modules first |
Don't lose your macros in a conversion
MacroKit gives you the exact workflow — pre-conversion inventory, safe conversion scripts, and post-conversion validation — so you never discover missing macros on Monday morning.
Get MacroKit — $9Or try the free Macro Inspector first.