XLS · BIFF8

Legacy Excel
API guide

The Excel API reads a rectangular preview from the first worksheet and edits selected cell records. It works with BIFF8 `.xls` streams and OLE-wrapped workbooks.

IMPLEMENTATION NOTES

What works

readOleXlsGrid returns a bounded grid (50 rows by 26 columns by default). Numeric edits update existing NUMBER or RK cells; string edits maintain the shared string table and can rebuild a single worksheet when the structure is recognized.

IMPLEMENTATION NOTES

Known limits

This is a data preview and cell writer, not an Excel calculation engine or workbook renderer.

QUICK EXAMPLE

Use the supported API

Import the package root unless a subpath is shown in the sample.

Legacy Excel · TypeScript
TypeScript
import {
  readOleXlsGrid,
  writeOleXlsNumericCellEdit,
  writeOleXlsStringCellEdit,
} from '@christophervr/ole2';

const grid = readOleXlsGrid(xlsBytes);
const numeric = writeOleXlsNumericCellEdit(xlsBytes, { row: 0, col: 0, value: 42 });
const text = writeOleXlsStringCellEdit(numeric, { row: 0, col: 1, value: 'Ready' });
if (text === xlsBytes) console.log('No supported edit was applied.');

This guide documents the current package API. Unsupported or unsafe operations are described explicitly; format detection alone does not imply content support.

Back to format overview