Microsoft has not published a specification of BIFF5 on its own: [MS-XLS] covers only BIFF8. The facts on this page come from the Microsoft Excel 97 Developer’s Kit (Microsoft Press, 1997), whose BIFF chapter describes BIFF5 and BIFF7 (Excel 95, which writes the same version number) alongside BIFF8. All numbers are little-endian.
Container and stream
A BIFF5 workbook is an OLE compound file (signature
D0 CF 11 E0 A1 B1 1A E1) whose workbook data is in a stream named
Book; BIFF8 renamed it Workbook. Like BIFF8, the stream is
a series of substreams, each from a BOF record to an EOF record: the workbook globals
first, then one per sheet.
Records
| Offset | Size | Field | Meaning |
|---|---|---|---|
0 | 2 | record number | The record type. |
2 | 2 | length | Length of the data. |
4 | length | data | The record’s fields. |
In BIFF7 and earlier a record may be at most 2,084 bytes including the 4-byte
header, so its data is at most 2,080 bytes (BIFF8 allows 8,224). Longer data carries
on in CONTINUE records (0x003C). Fields marked reserved are to be
ignored when read; those marked “must be zero” must be written as 0.
BOF (0x0809)
| Offset | Size | Field | Meaning |
|---|---|---|---|
0 | 2 | vers | 0x0500 for BIFF5 and BIFF7 (0x0600 is BIFF8). |
2 | 2 | dt | Substream type: 0x0005 workbook globals, 0x0006 Visual Basic module, 0x0010 worksheet or dialog sheet, 0x0020 chart, 0x0040 Excel 4.0 macro sheet, 0x0100 workspace file. |
4 | 2 | rupBuild | Build identifier (internal). |
6 | 2 | rupYear | Build year (internal). |
The BIFF5 BOF record is 8 bytes; BIFF8 adds 8 more. Older versions used other
record numbers for BOF, which is how they are told apart: 0x0009 BIFF2,
0x0209 BIFF3, 0x0409 BIFF4. BIFF5 and BIFF7 cannot be told
apart from the BOF record.
Text
BIFF5 has no Unicode and no shared string table. Text is stored as byte strings in
the workbook’s code page (the CODEPAGE record, 0x0042),
with a length before them: one byte for short names such as sheet names in
BOUNDSHEET (0x0085, which otherwise has the same stream
offset, visibility and sheet type as in BIFF8), two bytes for cell text in
LABEL (0x0204: row, column, XF index, then the string).
Cell text with character formatting uses RSTRING. The BIFF8 records
SST, EXTSST and LABELSST do not exist in
BIFF5.
Cell records
The Developer’s Kit lists these record types as holding cell data in BIFF5, BIFF7 and BIFF8: ARRAY, BLANK, BOOLERR, FORMULA, LABEL, LABELSST (BIFF8 only), MULBLANK, MULRK, NUMBER, RK, RSTRING, SHRFMLA and STRING. MULBLANK, MULRK and SHRFMLA were new in BIFF5. Apart from text, their layouts are those described for BIFF8; cells are grouped in row blocks with DBCELL and INDEX records in the same way.
EXTERNSHEET (0x0017)
In BIFF7 and earlier there is one EXTERNSHEET record per referenced workbook or
sheet, forming a table whose size is given by the EXTERNCOUNT record
(cxals). Each holds cch (1 byte), the length of the file
name, and the name rgch. (BIFF8 replaced this with a single record of
XTI entries pointing at SUPBOOK records.) The first character of the name says what
it is:
| Value | Name | Meaning |
|---|---|---|
0x00 | chEmpty | Reference to an empty workbook name. |
0x01 | chEncode | The file name is encoded, using the keys below. |
0x02 | chSelf | A reference to this workbook. |
| Key in an encoded name | Name | Meaning |
|---|---|---|
0x01 | chVolume | A drive letter follows; for a UNC name, @ stands for the leading backslashes. |
0x02 | chSameVolume | Same drive as the referring workbook. |
0x03 | chDownDir | Into a subdirectory (elsewhere in the name, 0x03 marks a DDE or OLE link). |
0x04 | chUpDir | Up to the parent directory. |
0x05 | chLongVolume | Not used. |
0x06 | chStartupDir | The startup directory. |
0x07 | chAltStartupDir | The alternate startup directory. |
0x08 | chLibDir | The Library directory. |
All BIFF5 and BIFF7 record types
The Excel 97 Developer’s Kit lists every record it documents in one alphabetical table, says its descriptions apply to BIFF5, BIFF7 and BIFF8 alike, and gives a separate table of the records that are new in BIFF8 (“File Format Versions”, “BIFF Record Order”, and for charts “New and Changed Chart Records”). The records below are therefore the kit’s list with the BIFF8-only ones taken out; those marked changed have a different layout in BIFF8, so their BIFF8 description on the BIFF8 pages does not apply as it stands. Numbers are as the kit prints them.
| Number | Record | Number | Record | Number | Record |
|---|---|---|---|---|---|
0x000A | EOF | 0x0050 | DCON | 0x00A1 | SETUP |
0x000C | CALCCOUNT | 0x0051 | DCONREF | 0x00A9 | COORDLIST |
0x000D | CALCMODE | 0x0052 | DCONNAME | 0x00AB | GCW |
0x000E | PRECISION | 0x0055 | DEFCOLWIDTH | 0x00AE | SCENMAN |
0x000F | REFMODE | 0x0059 | XCT (changed) | 0x00AF | SCENARIO |
0x0010 | DELTA | 0x005A | CRN | 0x00B0 | SXVIEW |
0x0011 | ITERATION | 0x005B | FILESHARING | 0x00B1 | SXVD |
0x0012 | PROTECT | 0x005C | WRITEACCESS (changed) | 0x00B2 | SXVI |
0x0013 | PASSWORD | 0x005D | OBJ (changed) | 0x00B4 | SXIVD |
0x0014 | HEADER | 0x005E | UNCALCED | 0x00B5 | SXLI |
0x0015 | FOOTER | 0x005F | SAVERECALC | 0x00B6 | SXPI |
0x0016 | EXTERNCOUNT | 0x0060 | TEMPLATE | 0x00B8 | DOCROUTE |
0x0017 | EXTERNSHEET | 0x0063 | OBJPROTECT | 0x00B9 | RECIPNAME |
0x0019 | WINDOWPROTECT | 0x007D | COLINFO | 0x00BC | SHRFMLA |
0x001A | VERTICALPAGEBREAKS (changed) | 0x007E | RK | 0x00BD | MULRK |
0x001B | HORIZONTALPAGEBREAKS | 0x007F | IMDATA | 0x00BE | MULBLANK |
0x001C | NOTE (changed) | 0x0080 | GUTS | 0x00C1 | MMS |
0x001D | SELECTION | 0x0081 | WSBOOL | 0x00C2 | ADDMENU |
0x0022 | 1904 | 0x0082 | GRIDSET | 0x00C3 | DELMENU |
0x0026 | LEFTMARGIN | 0x0083 | HCENTER | 0x00C5 | SXDI |
0x0027 | RIGHTMARGIN | 0x0084 | VCENTER | 0x00CD | SXSTRING |
0x0028 | TOPMARGIN | 0x0085 | BOUNDSHEET (changed) | 0x00D0 | SXTBL |
0x0029 | BOTTOMMARGIN | 0x0086 | WRITEPROT | 0x00D1 | SXTBRGIITM |
0x002A | PRINTHEADERS | 0x0087 | ADDIN | 0x00D2 | SXTBPG |
0x002B | PRINTGRIDLINES | 0x0088 | EDG | 0x00D3 | OBPROJ |
0x002F | FILEPASS | 0x0089 | PUB | 0x00D5 | SXIDSTM |
0x003C | CONTINUE | 0x008C | COUNTRY | 0x00D6 | RSTRING |
0x003D | WINDOW1 | 0x008D | HIDEOBJ | 0x00D7 | DBCELL |
0x0040 | BACKUP | 0x0090 | SORT | 0x00DA | BOOKBOOL |
0x0041 | PANE | 0x0091 | SUB | 0x00DC | SXEXT (changed) |
0x0042 | CODEPAGE | 0x0092 | PALETTE | 0x00DD | SCENPROTECT |
0x004D | PLS | 0x0094 | LHRECORD | 0x00DE | OLESIZE |
0x0095 | LHNGRAPH | 0x0096 | SOUND | 0x00DF | UDDESC |
0x0098 | LPR | 0x0099 | STANDARDWIDTH | 0x00E0 | XF (changed) |
0x009A | FNGROUPNAME | 0x009B | FILTERMODE | 0x00E1 | INTERFACEHDR |
0x009C | FNGROUPCOUNT | 0x009D | AUTOFILTERINFO | 0x00E2 | INTERFACEEND |
0x009E | AUTOFILTER | 0x00A0 | SCL | 0x00E3 | SXVS |
0x00EA | TABIDCONF | 0x0201 | BLANK | 0x0221 | ARRAY |
0x013D | TABID | 0x0203 | NUMBER | 0x0223 | EXTERNNAME |
0x01A5 | FILESHARING2 | 0x0204 | LABEL | 0x0225 | DEFAULTROWHEIGHT |
0x0200 | DIMENSIONS (changed) | 0x0205 | BOOLERR | 0x0231 | FONT |
0x0207 | STRING | 0x0236 | TABLE | ||
0x0208 | ROW | 0x023E | WINDOW2 (changed) | ||
0x020B | INDEX (changed) | 0x0293 | STYLE | ||
0x0218 | NAME | 0x0406 | FORMULA | ||
0x041E | FORMAT | ||||
0x0809 | BOF (changed) |
Two numbers differ from [MS-XLS]: the kit heads FORMULA as 406h and
FONT as 231h, while [MS-XLS] gives Formula 0x0006 and Font
0x0031 for BIFF8. Which number a BIFF5 file uses is not settled by the
sources read for this page, so a reader should accept both. The kit also heads
CODENAME as 42h (the number of CODEPAGE) in one place and
1BAh in its list of new BIFF8 records; CODENAME is BIFF8 only.
Chart records
Chart substreams use the records above 0x1000. In BIFF5 and BIFF7
they are all of the kit’s chart records except the eight new in BIFF8
(0x1060 to 0x1067: FBI, BOPPOP, AXCEXT, DAT, PLOTGROWTH,
SIINDEX, GELFRAME, BOPPOPCUSTOM):
| Number | Record | Number | Record | Number | Record |
|---|---|---|---|---|---|
0x1001 | UNITS | 0x101C | CHARTLINE | 0x103D | DROPBAR |
0x1002 | CHART | 0x101D | AXIS | 0x103E | RADAR (changed) |
0x1003 | SERIES (changed) | 0x101E | TICK (changed) | 0x103F | SURFACE (changed) |
0x1006 | DATAFORMAT | 0x101F | VALUERANGE | 0x1040 | RADARAREA |
0x1007 | LINEFORMAT (changed) | 0x1020 | CATSERRANGE | 0x1041 | AXISPARENT |
0x1009 | MARKERFORMAT (changed) | 0x1021 | AXISLINEFORMAT | 0x1043 | LEGENDXN |
0x100A | AREAFORMAT (changed) | 0x1022 | CHARTFORMATLINK (not used) | 0x1044 | SHTPROPS (changed) |
0x100B | PIEFORMAT | 0x1024 | DEFAULTTEXT | 0x1045 | SERTOCRT |
0x100C | ATTACHEDLABEL (changed) | 0x1025 | TEXT (changed) | 0x1046 | AXESUSED |
0x100D | SERIESTEXT | 0x1026 | FONTX | 0x1048 | SBASEREF |
0x1014 | CHARTFORMAT | 0x1027 | OBJECTLINK | 0x104A | SERPARENT |
0x1015 | LEGEND (changed) | 0x1032 | FRAME | 0x104B | SERAUXTREND |
0x1016 | SERIESLIST | 0x1033 | BEGIN | 0x104E | IFMT |
0x1017 | BAR (changed) | 0x1034 | END | 0x104F | POS |
0x1018 | LINE (changed) | 0x1035 | PLOTAREA | 0x1050 | ALRUNS |
0x1019 | PIE (changed) | 0x103A | 3D | 0x1051 | AI |
0x101A | AREA (changed) | 0x103C | PICF (changed) | 0x105B | SERAUXERRBAR |
0x101B | SCATTER (changed) | 0x105D | SERFMT (changed) |
Records that do not exist in BIFF5
New in BIFF8, per the kit: CF, CODENAME, CONDFMT, DCONBIN, DSF, DV, DVAL, EXTSST,
HLINK, LABELSST, MSODRAWING, MSODRAWINGGROUP, MSODRAWINGSELECTION, PARAMQRY (which
reuses SXEXT’s number 0x00DC), PROT4REV, PROT4REVPASS, QSI, REFRESHALL,
SST, SUPBOOK, SXDB, SXDBEX, SXEX, SXFDBTYPE, SXFILT, SXFMLA, SXFORMAT, SXFORMULA,
SXNAME, SXPAIR, SXRULE, SXSELECT, SXVDEX, TXO, USERBVIEW, USERSVIEWBEGIN,
USERSVIEWEND, USESELFS and XL5MODIFY (which is written in the BIFF5 Book
stream of a dual-format file, but by Excel 97). Every record [MS-XLS] adds after
these (types from 0x0800, the future records) is later still.
The shared-list (shared workbook) feature was added in Excel 95, so BIFF7 files may
hold RR… revision records and User Names and Revision Log streams; the
kit says their record data and the stream formats are not documented.
Not covered here
Each record’s BIFF5 field layout is not reproduced. The kit’s record descriptions cover all three versions and point out where BIFF5 and BIFF7 differ, and only the records marked changed differ in layout; text fields still differ throughout, since BIFF5 stores byte strings. The BIFF5 layouts of the changed records (beyond BOF and EXTERNSHEET above), BIFF5 formula tokens (whose 3-D references differ from BIFF8’s) and the BIFF5 forms of FONT, FORMAT, XF and NAME are in the kit’s record pages but are not yet described here.