Most "best Excel converter" roundups test speed, UI, and format range. Almost none of them test the thing that matters most to developers and Excel power users: whether VBA macros survive the conversion.
This is the list that fills that gap.
Every tool below was evaluated on three macro-specific criteria: 1. XLSM → PDF: Does VBA module code survive in any recoverable form? 2. XLSM → XLSX: Does the round-trip preserve macro structure? 3. Transparency: Does the tool warn you when macros will be dropped?
The rankings may surprise you. Tools with 200 million monthly users fail criteria 1, 2, and 3. Tools with a fraction of that user base pass all three.
| Rank | Tool | Macro Preservation | Best For | Starting Price | |------|------|--------------------|----------|----------------| | 1 | Macro-Safe Converter | Full — VBA extracted and packaged | Online conversion, SaaS workflows | $9/month | | 2 | COM Automation (Python + win32com) | Full — native Office fidelity | Windows-based enterprise pipelines | Free (requires Office license) | | 3 | Aspose.Cells (SDK) | Full — documented API | .NET/Java enterprise applications | $1,499/developer (perpetual) | | 4 | LibreOffice + VBA Extractor | Partial — extractable with scripts | Self-hosted/open-source deployments | Free | | 5 | CloudConvert | None — macros dropped | Non-macro format conversion | $9/month (500 credits) |
Not ranked (disqualified for silent macro stripping without disclosure): Smallpdf, ILovePDF, Zamzar, OnlineConvertFree, Adobe Acrobat Online
Best for: Developers, consultants, Excel power users who need an online converter that does not destroy VBA code.
Macro-Safe Converter is purpose-built for one workflow: convert XLSM, XLAM, XLSB, DOCM, and PPTM files while keeping the embedded VBA code accessible. It is the only online converter in this list that treats macro preservation as a feature rather than an afterthought.
How it works:
1. Upload your macro-containing Excel file
2. The converter extracts all VBA modules before transformation begins
3. Format conversion runs (PDF, XLSX, or other target)
4. Output is a ZIP: converted file + .bas files for each VBA module + manifest.json
5. Reimport the .bas files into any new XLSM using Excel's VBA editor
Test result — XLSM payroll template (847 lines VBA, 3 modules):
.bas files + manifestBest for: Internal enterprise tooling on Windows infrastructure, developers with Microsoft Office licenses.
COM automation drives a real Microsoft Excel instance via Windows Component Object Model. Because you're instructing Excel itself to perform the conversion — not a third-party library re-encoding the file — VBA code is never parsed or discarded. It simply remains in the file structure, exactly as authored.
import win32com.client
excel = win32com.client.Dispatch("Excel.Application")
excel.Visible = False
wb = excel.Workbooks.Open(r"C:\input\report.xlsm")
Preserve VBA by exporting modules before format change
for component in wb.VBProject.VBComponents:
if component.Type in [1, 2, 3]:
component.Export(rf"C:\backup\{component.Name}.bas")
Convert to PDF
wb.ExportAsFixedFormat(0, r"C:\output\report.pdf")
wb.Close(False)
excel.Quit()
Test result — XLSM payroll template:
Pricing: Free (requires Microsoft Office license, ~$10-20/month on Microsoft 365 Business)
Best for: Enterprise applications built on .NET, Java, Python, or C++ that need programmatic macro preservation with commercial support.
Aspose is a commercial document processing SDK with over 20 years in the market. Aspose.Cells provides explicit API methods for loading, reading, and writing VBA projects within Excel files. The macro preservation is documented, tested, and covered by enterprise support contracts.
// .NET example
using Aspose.Cells;
Workbook wb = new Workbook("input.xlsm");
VbaProject vba = wb.VbaProject;
// Export each VBA module
foreach (VbaModule module in vba.Modules) {
File.WriteAllText($"backup/{module.Name}.bas", module.Codes);
}
// Save as PDF
wb.Save("output.pdf", SaveFormat.Pdf);
Test result — XLSM payroll template:
Pricing: From $399/year (OEM) to $1,499+ perpetual
Best for: Self-hosted deployments, open-source SaaS, teams with engineering resources to build and maintain a custom pipeline.
LibreOffice alone does not preserve VBA. However, LibreOffice exposes the OLE compound document structure, and with a Python script using the oletools library, you can extract VBA modules before passing the file to LibreOffice for format conversion.
import oletools.olevba as olevba
import subprocess
Extract VBA before LibreOffice strips it
vba_parser = olevba.VBA_Parser('input.xlsm')
for (filename, stream_path, vba_filename, vba_code) in vba_parser.extract_macros():
with open(f"backup/{vba_filename}", 'w') as f:
f.write(vba_code)
LibreOffice handles the format conversion
subprocess.run([
'libreoffice', '--headless', '--convert-to', 'pdf',
'--outdir', 'output/', 'input.xlsm'
])
Test result — XLSM payroll template:
Pricing: Free (open source). Engineering time not free.
Best for: Non-macro Excel conversions, format conversions outside the Office ecosystem, developer API integrations.
CloudConvert is the most developer-friendly general-purpose converter. Its REST API is well-documented, it supports 200+ formats, and its credit-based pricing is fair for variable volume. For XLSX to PDF, XLSX to CSV, or any conversion where VBA is not present, it is a legitimate choice.
Why it's #5: CloudConvert does not preserve VBA. It converts XLSM files successfully but discards macro code silently. For completeness, it is listed here — and if your use case is exclusively non-macro files, CloudConvert belongs in your shortlist. If any of your files contain VBA, it belongs lower.
Pricing: $9/month (500 credits), or pay-as-you-go
Smallpdf, ILovePDF, Zamzar, Adobe Acrobat Online, and OnlineConvertFree all convert XLSM files. They all produce clean-looking output. None of them preserve VBA macros. None of them disclose this in their UI during the conversion process.
This is not a minor edge case. XLSM is the standard format for any Excel file that contains automation — and that describes a large fraction of business-critical spreadsheets. Discovering that your macros are gone after conversion is how support tickets and data recovery emergencies begin.
The tools above are not "bad" tools. They are the wrong tools for this specific use case.
You need online conversion, fast, with VBA preserved: Macro-Safe Converter — $9/month, no integration required
You have a Windows server with Office licenses and internal infrastructure: COM Automation via win32com — free once setup, best-in-class fidelity
You're building an enterprise .NET or Java application: Aspose.Cells — commercial SDK with full VBA API support
You're self-hosting and have engineering bandwidth: LibreOffice + oletools pipeline — free, maintainable, flexible
Your files have no macros: CloudConvert, Zamzar, or ILovePDF — all are fine, pick based on pricing and format requirements
Which tool is best for converting XLSM to PDF without losing macros? Macro-Safe Converter is the only online tool in 2026 that extracts VBA modules and packages them with the PDF output. For offline/server-based options, COM Automation or Aspose.Cells also preserve macros fully.
Why do Smallpdf and ILovePDF strip macros? Both tools use LibreOffice-based conversion pipelines optimised for general-purpose format transformation. LibreOffice does not expose VBA preservation as a configurable option in standard export workflows. The tools are not designed for macro preservation — it's an architectural constraint, not a deliberate omission.
Can I get my macros back after converting with Zamzar or Smallpdf? No. Once an XLSM file is converted to PDF or plain XLSX by a general-purpose converter, the VBA code is gone from the output. If you still have the original XLSM file, your macros are safe there. If you only have the converted output, the macro code is not recoverable.
What is the Macro-Safe Converter membership? The $9/month membership includes unlimited conversions, full VBA extraction on every job, batch upload, API access, and monthly research drops covering keyword data and competitive intelligence for file-conversion SaaS builders. Join here →
Does macro preservation matter for XLSX files? No. XLSX is the non-macro Excel format. If your file is XLSX (not XLSM), it contains no VBA macros and all converters handle it correctly. Macro preservation only applies to macro-enabled formats: XLSM, XLSB, XLAM, DOCM, PPTM.
The best Excel macro-safe converter in 2026 is the one that treats VBA preservation as a first-class feature — not as a silent casualty of the conversion process.
For online conversions with no integration overhead: Macro-Safe Converter at $9/month.
For everything else: match the tool to your infrastructure (COM, Aspose, LibreOffice+oletools) and stay away from general-purpose consumer converters when macros are involved.
Protect your Excel macros — join the membership for $9/month →
Schema: ItemList (software tools ranking), Article, FAQPage
Macro-Safe Converter preserves VBA macros through XLSM conversions. One-time kit — no subscription.
Get the Kit — $9 one-time →