Excel Reader
View and edit spreadsheets inside VS Code in a clean grid that follows your theme.
| Format |
View |
Edit |
Opens by default |
.xlsx |
✓ |
✓ |
yes |
.xlsm |
✓ |
✓ (macros preserved) |
yes |
.csv, .tsv |
✓ |
✓ |
yes |
To see the raw text of a CSV/TSV, use the Open as Text button in the editor title bar (or Excel Reader: Open as Text). To make text the default again, add this to your settings:
"workbench.editorAssociations": { "*.csv": "default", "*.tsv": "default" }
Viewing
- Sheet tabs (Ctrl/Cmd+PageUp/PageDown switches sheets), frozen panes, merged cells, column widths, row heights, and hidden rows and columns
- Conditional formatting: rules written as formulas or as "cell value is …" comparisons, so Gantt bars, "today" markers and status colours show as in Excel. Colour scales, data bars and icon sets aren't shown yet
- Opens at the zoom saved in the file, and hides gridlines when the file does
- Bold, italic, underline, font and fill colours, alignment and wrapping
- Excel number formats: currency, percentages, dates, thousands separators
- Text overflows into empty neighbouring cells, as in Excel
- Smooth scrolling on large sheets: rows load on demand, and 100k+ rows are fine
- Address box: type
B12 or A1:C20 and press Enter to jump there
- Find (Ctrl/Cmd+F) searches displayed values and formulas
- Status bar shows Count, Sum and Average for the selection
View controls
These change only what you see; the file is never modified.
| Control |
What it does |
| Zoom (bottom right) |
− / + to zoom out or in, click the percentage to reset to 100%. Ctrl/Cmd + scroll or a trackpad pinch also zooms |
| Freeze ▾ (toolbar) |
Freeze above and left of the selected cell, freeze the top row or first column, or unfreeze |
| Freeze ▾ → Collapse Locked Rows / Columns |
Folds a large locked area away. It keeps the last locked row (the header row) and the widest locked column (usually the name column). Click again to expand |
| Freeze ▾ → Reset View |
Back to the file's own freeze and zoom |
| Right-click → Hide Rows / Hide Columns |
Hide lines from view. A marker on the header shows where lines are hidden; select across it and choose Unhide, or Show All Hidden Rows & Columns |
| Page button (toolbar) |
Paper mode: shows the sheet on white like Excel, whatever your colour theme. Useful for files with white fills or white text. Saved as the excelReader.paperMode setting |
Editing
| Action |
How |
| Edit a cell |
Start typing, or double-click or press F2. Enter/Tab commits, Esc cancels, Alt+Enter adds a new line |
| Formula |
Type =SUM(B2:B5). Excel calculates it when the file is next opened there; until then the formula shows in italics |
Text that starts with = |
Prefix it with ' |
| Clear |
Delete or Backspace |
| Copy / cut / paste |
Ctrl/Cmd+C/X/V. Pasting inside Excel Reader keeps the formatting (fill, font, borders, number format, alignment); formulas paste as their results. Pasting into Excel, Google Sheets or Word keeps colours and fonts too |
| Insert or delete rows and columns |
Right-click a cell or a row/column header |
| Highlight (fill colour) |
Toolbar paint-bucket button applies the last colour; ▾ opens the palette (also No fill and More colours…). Right-click → Highlight / Clear Highlight |
| Text colour |
Toolbar A button, same way |
| Resize a column |
Drag the right edge of its letter; double-click the edge to fit the content |
| Resize a row |
Drag the bottom edge of its number; double-click the edge to reset it. Select several whole rows or columns first to resize them all at once |
| Add, rename or delete sheets |
+ button; double-click a tab to rename; right-click a tab for more options |
| Undo / redo |
Ctrl/Cmd+Z, Ctrl/Cmd+Shift+Z |
| Save |
Ctrl/Cmd+S (Save As and Revert also work) |
Limitations
- No full formula engine. Cell values show the results Excel last calculated. A small evaluator runs only the conditional-formatting rules, and supports common functions such as
TODAY, AND/OR/IF, date functions, SUM/MIN/MAX and text search. Edited formulas are calculated when the file is next opened in Excel; the file is saved with "recalculate on open" set.
- Moving rows and columns does not rewrite formula references that point across the change. Merged cells and column widths do move with the data.
- Content Excel Reader cannot preserve: charts, pivot tables, slicers, timelines, threaded comments, form controls and external links are removed on save. A banner warns you when a workbook contains any of these.
- CSV/TSV can't store colours or sizes: the colour buttons are disabled, and row/column resizing only changes the view.
- CSV: values are saved exactly as typed. Quotes are only written where needed, so a field like
"New York" is saved as New York.
- Legacy
.xls and .ods are not supported.
Settings
excelReader.maxFileSizeMB (default 50): asks before opening larger files.
excelReader.showGridlines (default true)
excelReader.paperMode (default false): show sheets on white like Excel
excelReader.sizing (default matchExcel): draw rows, columns and text at the size Excel uses on your computer. Excel for Mac draws sheets 25% smaller than Excel for Windows; choose windows or mac to force one
Development
npm install
npm run build # bundles dist/extension.js and dist/webview.js
npm test # model unit tests (vitest)
npm run test:e2e # opens files in a real VS Code
npm run dev # browser harness on http://localhost:5317/?file=styled.xlsx (add &light for the light theme)
node scripts/make-fixtures.mjs # regenerate test/fixtures
Press F5 in VS Code to launch an Extension Development Host with test/fixtures open.
Layout
src/model/: format-independent SheetModel, implemented by XlsxModel (ExcelJS) and CsvModel (papaparse). xlsmMacros.ts puts the VBA project back after ExcelJS writes the file.
src/editor/: the VS Code custom editor (document, save/backup/revert, undo stack).
webview/: virtualized grid, toolbar, tabs, menus and find. No framework.
src/shared/: the typed message protocol between the extension host and the webview.
| |