Should you save your file as .xlsx or .xlsb? This guide explains the differences, with examples, downloadable templates, and VBA code.
What is the Difference?
.xlsx is XML-based, compressed, and widely compatible. .xlsb is binary, faster, and often smaller but less compatible with non-Excel tools.
Quick Comparison
Feature | .xlsx | .xlsb |
---|---|---|
File Size | Larger | Smaller (often 1/3 smaller) |
Speed | Slower on large files | Faster open/save |
Macro Support | .xlsm needed for macros | Supports VBA macros |
Compatibility | Excellent across platforms | Limited to Excel |
Recovery | Easier to salvage | Harder to recover if corrupted |
Use Cases
- Basic workbooks: Use .xlsx for sharing and compatibility.
- Large datasets with automation: Use .xlsb for speed and size savings.
- Macro-heavy automation: .xlsb is preferred for VBA-driven workflows.
Download Templates
Download Basic Template (.xlsx)
Download Advanced Template (.xlsb inside ZIP) (Unzip to use)
Example VBA Code
' Toggle row highlight Sub ToggleHighlight() Dim r As Range Set r = ActiveCell.EntireRow If r.Interior.Color = vbGreen Then r.Interior.Color = xlNone Else r.Interior.Color = vbGreen End If End Sub ' Import CSV into workbook Sub ImportCSV() Dim f As String f = Application.GetOpenFilename("CSV Files (*.csv),*.csv") If f = "False" Then Exit Sub Workbooks.Open f ActiveSheet.Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count) ActiveWorkbook.Close False End Sub
GIF Demonstration
Watch the feature in action:
Summary
Use .xlsx for sharing and compatibility. Choose .xlsb for large, macro-heavy workbooks where speed and size matter. Always keep backups!