XLS Preview — VS Code Extension
Preview .xls and .xlsx spreadsheet files directly inside VS Code using a rich, interactive table viewer.
Features
| Feature |
Details |
| 📊 Multi-sheet support |
Navigate between sheets via tabs at the top |
| 🔍 In-sheet search |
Ctrl+F to search; Enter / Shift+Enter to cycle matches |
| 📋 Copy cell / row |
Right-click any cell to copy its value or the whole row as TSV |
| 💾 Export CSV |
Export the current sheet as CSV |
| 🎨 VS Code theme aware |
Automatically adapts to your light/dark theme |
| 🔢 Row & column headers |
Excel-style column letters (A, B, … Z, AA, …) and row numbers |
| ⚡ Large file handling |
Configurable row limit with a truncation notice |
| 📅 Date parsing |
Dates are rendered in human-readable ISO format |
Usage
- Open the Run & Debug panel (Ctrl+Shift+D)
- Select "Run Extension (no build)" from the dropdown
- Click the green ▶ play button -> A new vscode window open.
- Open any
.xls or .xlsx file in VS Code — the preview opens automatically.
- Right-click a
.xls/.xlsx file in the Explorer and choose Open XLS Preview.
- Use
Ctrl+F inside the preview to search for text.
Extension Settings
| Setting |
Default |
Description |
xlsPreview.maxRows |
1000 |
Maximum rows displayed per sheet |
xlsPreview.theme |
"auto" |
Color theme: auto, light, or dark |
xlsPreview.frozenHeaders |
true |
Freeze the header row while scrolling |
Development
# Install dependencies
cd xls-preview
npm install
# Compile TypeScript
npm run compile
# Watch mode
npm run watch
# Package as .vsix
npm run package
Press F5 in VS Code (with the xls-preview folder open) to launch the Extension Development Host.
How It Works
.xls / .xlsx file
│
▼
XlsParser (xlsx library)
│ parses sheets, rows, cells
▼
XlsEditorProvider
│ serialises data to JSON
▼
Webview HTML + JS
│ renders interactive table
▼
User
src/extension.ts — activates the extension and registers the command.
src/xlsEditorProvider.ts — implements CustomReadonlyEditorProvider; builds the webview HTML.
src/xlsParser.ts — wraps the xlsx library to extract typed cell data.
src/utils.ts — CSP nonce helper.
License
MIT
| |