Excel Format Guide

XLSM vs XLSX: What's the Difference?
(And Why It Matters for Macros)

Sponsored
By MacroKit · Updated April 2026 · 8 min read

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.

The short answer: XLSX cannot store VBA macros. XLSM is structurally identical to XLSX except it includes a binary 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 baseOpen XML (ZIP)Open XML (ZIP)
Can store VBA macrosNo — stripped on saveYes — vbaProject.bin
Can store UserFormsNoYes
Can store VBA class modulesNoYes
Can store Excel 4 macros (XLM)NoYes (legacy)
Typical file size (same data)SmallerLarger by ~10-50KB
Security warning on openNone"Enable Content" prompt
SharePoint/OneDrive compatibleFull supportLimited (macros blocked)
Google Sheets importNativeOpens, 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.

Warning — renaming doesn't work: Changing a file extension from .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:

  1. Export to target format, drop vbaProject.bin — the macro code is silently deleted with no warning
  2. 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.

Real scenario: An accountant uploads a 47-worksheet XLSM with 12 VBA modules to CloudConvert for a "format cleanup." The output looks identical. Opens fine. The macros are gone. She doesn't discover this until the following Monday when the automated report fails to generate. Three days of re-coding follows.

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:

Use XLSM when:

Use XLSB when:

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:

  1. 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).
  2. Create a macro-free copy. File → Save As → Excel Workbook (.xlsx). This is your sharing copy — no macros, fully compatible.
  3. Keep the XLSM original. Never overwrite it. The XLSX is a derived artefact, not the master.
  4. Document what's lost. Add a README worksheet to the XLSX noting which functionality requires macros and where to find the XLSM original.
Batch conversion: If you need to convert dozens of XLSM files to XLSX while archiving all macro code, the MacroKit conversion workflow includes a Python script that extracts all modules before conversion and creates a structured backup per file.

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

QuestionAnswer
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 — $9

Or try the free Macro Inspector first.

Related Guides