These records describe how a sheet is shown and printed. They sit in a worksheet substream (most also in macro, dialog or chart sheet substreams) between its BOF and EOF. Section numbers are those of [MS-XLS] v20250819; offsets count from the start of the record data and integers are little-endian. Rows, cells and column widths are on cells and rows; Protect and Password, which also protect sheets, and the future record headers are on workbook settings.
Window, panes and selection
Window2 (0x023E)
The sheet’s view in a workbook window; one per Window1 record, in the same order
(2.4.346). It is 18 bytes, or 10 in a chart sheet, where only
fSelected is used.
| Offset | Size | Field | Meaning |
|---|---|---|---|
0 | 2 | flags | Bit 0 fDspFmlaRt (show formulas, not values); 1 fDspGridRt (gridlines); 2 fDspRwColRt (row and column headings); 3 fFrozenRt (panes frozen; 0 when colLeft is 255 or rwTop 65,535); 4 fDspZerosRt (show zeros; 0 shows them blank); 5 fDefaultHdr (gridlines in the default colour rather than icvHdr); 6 fRightToLeft; 7 fDspGuts (outline symbols); 8 fFrozenNoSplit (frozen without a split); 9 fSelected (sheet tab selected); 10 fPaged (sheet shown in the window); 11 fSLV (Page Break Preview); 12–15 reserved. |
2 | 2 | rwTop | First visible row. |
4 | 2 | colLeft | First visible column. |
6 | 2 | icvHdr | Gridline colour index, at most 64; 64 exactly when fDefaultHdr is 1. |
8 | 2 | reserved | |
10 | 2 | wScaleSLV | Zoom in Page Break Preview, 10 to 400 %, or 0 for the default (overridden by Scl when that view is current). |
12 | 2 | wScaleNormal | Zoom in Normal view, likewise. |
14 | 2 | unused | |
16 | 2 | reserved |
Pane (0x0041)
Where the window is split (2.4.189): x (2) and y (2), the
split position, in cells when the panes are frozen (x at most 255) and in twips
otherwise (at most 32,767); rwTop (2), the top row of the bottom pane;
colLeft (2), the left column of the right pane; pnnAcct
(1), the active pane; 1 reserved byte. Panes (PaneType, 2.5.196): 0 bottom right, 1
top right, 2 bottom left, 3 top left.
Selection (0x001D)
| Offset | Size | Field | Meaning |
|---|---|---|---|
0 | 1 | pnn | The pane (PaneType). |
1 | 2 | rwAct | Row of the active cell. |
3 | 2 | colAct | Column of the active cell. |
5 | 2 | irefAct | Which range holds the active cell (counting across consecutive Selection records for the same pane). |
7 | 2 | cref | Number of ranges, at most 1,369. |
9 | 6 each | rgref | RefU ranges: first and last row (2 each), first and last column (1 byte each) (2.5.211). |
A large selection is split over several consecutive Selection records with the same pane and active cell (2.4.248).
| Type | Record | Data |
|---|---|---|
0x00A0 | Scl | nscl (2) and dscl (2), both at least 1: the zoom is nscl ÷ dscl, from 1/10 to 4. Required whenever the zoom is not 1 (2.4.247). |
0x088B | PLV | FrtHeader (12); wScalePLV (2, Page Layout zoom 10 to 400 %, 0 not set); 2 bytes of flags: bit 0 fPageLayoutView (the sheet is in Page Layout view; 0 when fSLV is set), bit 1 fRulerVisible, bit 2 fWhitespaceHidden (margins between pages hidden) (2.4.200). |
0x0097 | Sync | rw (2), col (2): the top-left visible cell of all windows when synchronised scrolling is on (2.4.318). |
SheetExt (0x0862)
Sheet tab colour and more (2.4.259): FrtHeader (12); cb (4, the record
size, 0x28 when the optional part is present); 4 bytes whose bits 0–6
are icvPlain, the tab colour as a palette index 8 to 63 or
0x7F for none; then, if cb is 0x28, a 20-byte
SheetExtOptional (2.5.238): 4 bytes with bits 0–6 icvPlain12 (tab colour
again; icvPlain wins if they differ), bit 7 fCondFmtCalc
(conditional formatting formulas are evaluated), bit 8 fNotPublished
(the sheet is not published to a server); then a 16-byte
CFColor for the tab,
which may here be automatic.
Sheet options and outlines
WsBool (0x0081)
| Bits | Field | Meaning |
|---|---|---|
| 0 | fShowAutoBreaks | Show automatic page breaks. |
| 1–3 | reserved | |
| 4 | fDialog | The sheet is a dialog sheet. |
| 5 | fApplyStyles | Apply outline styles when outlining. |
| 6 | fRowSumsBelow | Summary rows below their detail rows. |
| 7 | fColSumsRight | 0: summary columns to the right of detail columns in a left-to-right sheet (left in a right-to-left one); 1: the other side. |
| 8 | fFitToPage | Fit the print to the page counts in Setup. |
| 9 | reserved | |
| 10–11 | unused | |
| 12, 13 | fSyncHoriz, fSyncVert | Synchronised horizontal and vertical scrolling across windows. |
| 14, 15 | fAltExprEval, fAltFormulaEntry | Transition (Lotus-style) formula evaluation and entry. |
Guts (0x0080, 2.4.134): two unused 2-byte
fields, then iLevelRwMac and iLevelColMac (2 each), the
deepest row and column outline levels: 0 none, otherwise level + 1 (2 for level 1 up
to 8 for level 7).
GridSet (0x0082): 2 bytes, reserved,
always 1 (2.4.132).
Default sizes
DefaultRowHeight (0x0225)
Height of rows with no Row record (2.4.87): 2 bytes of flags (bit 0
fUnsynced, the default height was changed; bit 1 fDyZero,
empty rows are hidden; bit 2 fExAsc and bit 3 fExDsc, thick
top or bottom borders on empty rows; 4–15 reserved), then 2 bytes: when
fDyZero is 0, miyRw, the height in twips (1 to 8,179); when
it is 1, miyRwHidden, the height the rows take when unhidden (0 to
8,179).
| Type | Record | Data |
|---|---|---|
0x0055 | DefColWidth | cchdefColWidth (2, at most 255): default column width in characters. ColInfo records follow it (2.4.89). |
0x0099 | DxGCol | dxgCol (2): default width of columns with no ColInfo, in 1/256 of the width of the widest digit in the Normal style’s font (2.4.98). |
Printing
| Type | Record | Data |
|---|---|---|
0x0026 | LeftMargin | num (8, a double): left margin in inches, 0 to 49 (2.4.151). |
0x0027 | RightMargin | Right margin, the same way (2.4.219). |
0x0028 | TopMargin | Top margin (2.4.328). |
0x0029 | BottomMargin | Bottom margin (2.4.27). |
0x0083 | HCenter | hcenter (2, Boolean): centre the print between the left and right margins (2.4.135). |
0x0084 | VCenter | Centre between the top and bottom margins (2.4.342). |
0x002B | PrintGrid | 2 bytes, bit 0 fPrintGrid: print gridlines (2.4.202). |
0x002A | PrintRowCol | printRwCol (2, Boolean): print row and column headings (2.4.203; the specification’s value table describes both 0 and 1 as “not printed”, an evident slip). |
0x0033 | PrintSize | printSize (2), for a chart printed on its own page: 0 unchanged (inside a custom view), 1 fill the page, 2 fill the page keeping proportions, 3 the size given in the Chart record (2.4.204). |
0x004D | Pls | 2 reserved bytes, then a Windows DEVMODE structure with the printer settings, carried on in Continue records (2.4.199). |
Setup (0x00A1)
| Offset | Size | Field | Meaning |
|---|---|---|---|
0 | 2 | iPaperSize | Paper size; 0 or 256 and above are printer-specific sizes. |
2 | 2 | iScale | Print scale in per cent. |
4 | 2 | iPageStart | First page number (signed), used when fUsePage is 1. |
6 | 2 | iFitWidth | Pages wide to fit to (0 as many as needed). |
8 | 2 | iFitHeight | Pages tall to fit to (0 as many as needed). |
10 | 2 | flags | Bit 0 fLeftToRight (page order: 1 across then down, 0 down then across); 1 fPortrait (1 portrait, 0 landscape); 2 fNoPls (paper size, scale, resolutions, copies and orientation are undefined); 3 fNoColor (black and white); 4 fDraft; 5 fNotes (print comments); 6 fNoOrient (orientation not set); 7 fUsePage (use iPageStart); 8 unused; 9 fEndNotes (comments at the end rather than as displayed); 10–11 iErrors: 0 print errors as shown, 1 blank, 2 as --, 3 as #N/A; 12–15 reserved. |
12 | 2 | iRes | Print resolution in dots per inch. |
14 | 2 | iVRes | Vertical resolution. |
16 | 8 | numHdr | Header margin in inches (double, below 49). |
24 | 8 | numFtr | Footer margin in inches. |
32 | 2 | iCopies | Number of copies. |
| Size | Paper | Size | Paper | Size | Paper |
|---|---|---|---|---|---|
| 1 | US Letter 8½ × 11 in | 41 | German Legal Fanfold 8½ × 13 in | 81 | Japanese Postcard Rotated 148 × 100 mm |
| 2 | US Letter Small 8½ × 11 in | 42 | B4 (ISO) 250 × 353 mm | 82 | Double Japanese Postcard Rotated 148 × 200 mm |
| 3 | US Tabloid 11 × 17 in | 43 | Japanese Postcard 100 × 148 mm | 83 | A6 Rotated 148 × 105 mm |
| 4 | US Ledger 17 × 11 in | 44 | 9 × 11 in | 84 | Japanese Envelope Kaku #2 Rotated |
| 5 | US Legal 8½ × 14 in | 45 | 10 × 11 in | 85 | Japanese Envelope Kaku #3 Rotated |
| 6 | US Statement 5½ × 8½ in | 46 | 15 × 11 in | 86 | Japanese Envelope Chou #3 Rotated |
| 7 | US Executive 7¼ × 10½ in | 47 | Envelope Invite 220 × 220 mm | 87 | Japanese Envelope Chou #4 Rotated |
| 8 | A3 297 × 420 mm | 48, 49 | Reserved, not to be used | 88 | B6 (JIS) 128 × 182 mm |
| 9 | A4 210 × 297 mm | 50 | US Letter Extra 9½ × 12 in | 89 | B6 (JIS) Rotated 182 × 128 mm |
| 10 | A4 Small 210 × 297 mm | 51 | US Legal Extra 9½ × 15 in | 90 | 12 × 11 in |
| 11 | A5 148 × 210 mm | 52 | US Tabloid Extra 11.69 × 18 in | 91 | Japanese Envelope You #4 |
| 12 | B4 (JIS) 250 × 354 mm | 53 | A4 Extra 9.27 × 12.69 in | 92 | Japanese Envelope You #4 Rotated |
| 13 | B5 (JIS) 182 × 257 mm | 54 | Letter Transverse 8½ × 11 in | 93 | PRC 16K 146 × 215 mm |
| 14 | Folio 8½ × 13 in | 55 | A4 Transverse 210 × 297 mm | 94 | PRC 32K 97 × 151 mm |
| 15 | Quarto 215 × 275 mm | 56 | Letter Extra Transverse 9½ × 12 in | 95 | PRC 32K (Big) 97 × 151 mm |
| 16 | 10 × 14 in | 57 | SuperA/A4 227 × 356 mm | 96 | PRC Envelope #1 102 × 165 mm |
| 17 | 11 × 17 in | 58 | SuperB/A3 305 × 487 mm | 97 | PRC Envelope #2 102 × 176 mm |
| 18 | US Note 8½ × 11 in | 59 | US Letter Plus 8.5 × 12.69 in | 98 | PRC Envelope #3 125 × 176 mm |
| 19 | US Envelope #9 3⅞ × 8⅞ in | 60 | A4 Plus 210 × 330 mm | 99 | PRC Envelope #4 110 × 208 mm |
| 20 | US Envelope #10 4⅛ × 9½ in | 61 | A5 Transverse 148 × 210 mm | 100 | PRC Envelope #5 110 × 220 mm |
| 21 | US Envelope #11 4½ × 10⅜ in | 62 | B5 (JIS) Transverse 182 × 257 mm | 101 | PRC Envelope #6 120 × 230 mm |
| 22 | US Envelope #12 4¾ × 11 in | 63 | A3 Extra 322 × 445 mm | 102 | PRC Envelope #7 160 × 230 mm |
| 23 | US Envelope #14 5 × 11½ in | 64 | A5 Extra 174 × 235 mm | 103 | PRC Envelope #8 120 × 309 mm |
| 24 | C size sheet | 65 | B5 (ISO) Extra 201 × 276 mm | 104 | PRC Envelope #9 229 × 324 mm |
| 25 | D size sheet | 66 | A2 420 × 594 mm | 105 | PRC Envelope #10 324 × 458 mm |
| 26 | E size sheet | 67 | A3 Transverse 297 × 420 mm | 106 | PRC 16K Rotated |
| 27 | Envelope DL 110 × 220 mm | 68 | A3 Extra Transverse 322 × 445 mm | 107 | PRC 32K Rotated |
| 28 | Envelope C5 162 × 229 mm | 69 | Japanese Double Postcard 200 × 148 mm | 108 | PRC 32K (Big) Rotated |
| 29 | Envelope C3 324 × 458 mm | 70 | A6 105 × 148 mm | 109 | PRC Envelope #1 Rotated 165 × 102 mm |
| 30 | Envelope C4 229 × 324 mm | 71 | Japanese Envelope Kaku #2 | 110 | PRC Envelope #2 Rotated 176 × 102 mm |
| 31 | Envelope C6 114 × 162 mm | 72 | Japanese Envelope Kaku #3 | 111 | PRC Envelope #3 Rotated 176 × 125 mm |
| 32 | Envelope C65 114 × 229 mm | 73 | Japanese Envelope Chou #3 | 112 | PRC Envelope #4 Rotated 208 × 110 mm |
| 33 | Envelope B4 250 × 353 mm | 74 | Japanese Envelope Chou #4 | 113 | PRC Envelope #5 Rotated 220 × 110 mm |
| 34 | Envelope B5 176 × 250 mm | 75 | Letter Rotated 11 × 8½ in | 114 | PRC Envelope #6 Rotated 230 × 120 mm |
| 35 | Envelope B6 176 × 125 mm | 76 | A3 Rotated 420 × 297 mm | 115 | PRC Envelope #7 Rotated 230 × 160 mm |
| 36 | Envelope 110 × 230 mm | 77 | A4 Rotated 297 × 210 mm | 116 | PRC Envelope #8 Rotated 309 × 120 mm |
| 37 | US Envelope Monarch 3.875 × 7.5 in | 78 | A5 Rotated 210 × 148 mm | 117 | PRC Envelope #9 Rotated 324 × 229 mm |
| 38 | 6¾ US Envelope 3⅝ × 6½ in | 79 | B4 (JIS) Rotated 364 × 257 mm | 118 | PRC Envelope #10 Rotated 458 × 324 mm |
| 39 | US Std Fanfold 14⅞ × 11 in | 80 | B5 (JIS) Rotated 257 × 182 mm | 119–255 | Reserved |
| 40 | German Std Fanfold 8½ × 12 in |
Page breaks
HorizontalPageBreaks
(0x001B, 2.4.142): cbrk (2, at most 1,026) and that many
6-byte HorzBrk: row (the first row below the break),
colStart, colEnd (the columns it spans, up to 16,383),
sorted by row then column, not overlapping.
VerticalPageBreaks (0x001A,
2.4.343): cbrk (at most 255) and VertBrk entries: col (the
first column right of the break), rowStart, rowEnd.
Headers and footers
Header (0x0014) and
Footer (0x0015) hold the text printed at the
top and bottom of every page (or of odd pages, see below) as an XLUnicodeString of at
most 255 characters; an empty record means none (2.4.136, 2.4.124). The text may hold
these codes:
| Code | Meaning | Code | Meaning |
|---|---|---|---|
&L, &C, &R | Start the left, centre or right section (repeats are joined) | &B, &I | Bold, italic on or off |
&P | Page number | &U, &E | Single, double underline on or off |
&N, optionally followed by + or - and digits | Total number of pages | &S | Strikethrough on or off |
&D, &T | Date, time | &X, &Y | Superscript, subscript on or off (not both) |
&Z, &F | Workbook path, workbook file name | &nn | Font size in points (1 to 3 digits) |
&A | Sheet name | &"font,type" | Font name (or -) and style: regular, bold, italic, bold italic (may be localised) |
&G | Picture (from HFPicture) | && | A literal ampersand; & with anything else is ignored |
HeaderFooter (0x089C)
| Offset | Size | Field | Meaning |
|---|---|---|---|
0 | 12 | frtHeader | FrtHeader. |
12 | 16 | guidSView | The custom view it belongs to (the GUID of the preceding UserSViewBegin), or zero for the sheet itself. |
28 | 2 | flags | Bit 0 fHFDiffOddEven (Header and Footer are for odd pages, the strings below for even pages); 1 fHFDiffFirst (a different first page); 2 fHFScaleWithDoc; 3 fHFAlignMargins (align with the page margins); 4–15 unused. |
30 | 2 × 4 | cchHeaderEven, cchFooterEven, cchHeaderFirst, cchFooterFirst | Lengths (at most 255; 0 when the matching flag is off). |
38 | varies | strHeaderEven, strFooterEven, strHeaderFirst, strFooterFirst | XLUnicodeStrings with the same codes as Header. |
HFPicture (0x0866)
Pictures for &G (2.4.138): FrtHeader (12); a flags byte (bit 0
fIsDrawing: the data is an OfficeArtDgContainer; bit 1
fIsDrawingGroup: it is an OfficeArtDggContainer, exactly one of the two
being set; bit 2 fContinue: continues the previous HFPicture); 1 reserved
byte; then the drawing data, an Office Drawing container defined in [MS-ODRAW].
Merged cells, hyperlinks and validation
| Type | Record | Data |
|---|---|---|
0x00E5 | MergeCells | cmcs (2, at most 1,026) and that many Ref8 ranges, each merged into one cell; ranges do not overlap; more merges go in further MergeCells records straight after (2.4.168). |
0x01B8 | HLink | ref8 (8, Ref8U: the cells), hlinkClsid (16, the class id of the component that saved the link), then a Hyperlink Object as defined in [MS-OSHARED] section 2.3.7.1 (address, location, display text, target frame) (2.4.140). |
0x0800 | HLinkTooltip | FrtRefHeaderNoGrbit (10, its range equal to an HLink’s), then the screen tip as null-terminated UTF-16, 2 to 256 characters with the null (2.4.141). |
0x086C | CellWatch | FrtRefHeaderU (12, fFrtRef 1, its range the watched cell), 4 reserved bytes (2.4.41). |
0x00EF | PhoneticInfo | phs (4): font index (2), then bits 0–1 phType (0 narrow katakana, 1 wide katakana, 2 hiragana, 3 any) and bits 2–3 alcH (0 general, 1 left, 2 centre, 3 distributed); then a SqRef (2-byte count, Ref8 ranges) of the cells whose phonetic text is shown (2.4.192, 2.5.201). |
DVal (0x01B2)
Starts the data validation records of the sheet (2.4.96): 2 bytes of flags (bit 0
fWnClosed, the input window is closed); xLeft and
yTop (4 each, position of the input window in pixels); idObj
(4, the drop-down button’s object id, or −1 when none is showing);
idvMac (4, the number of Dv records that follow, up to 65,534).
Dv (0x01BE)
| Offset | Size | Field | Meaning |
|---|---|---|---|
0 | 4 | flags | Bits 0–3 valType: 0 any value, 1 whole number, 2 decimal, 3 list, 4 date, 5 time, 6 text length, 7 custom formula. Bits 4–6 errStyle: 0 stop, 1 warning, 2 information. Bit 7 fStrLookup (the list is given as text). Bit 8 fAllowBlank. Bit 9 fSuppressCombo (no in-cell drop-down). Bits 10–17 mdImeMode (for Chinese, Japanese and Korean input): 0 no control, 1 on, 2 off (English), 4 hiragana, 5 wide katakana, 6 narrow katakana, 7 full-width alphanumeric, 8 half-width alphanumeric, 9 full-width hangul, 10 half-width hangul. Bit 18 fShowInputMsg. Bit 19 fShowErrorMsg. Bits 20–23 typOperator: 0 between, 1 not between, 2 equal, 3 not equal, 4 greater, 5 less, 6 greater or equal, 7 less or equal (not used for types 0, 3, 7). Bits 24–31 reserved. |
4 | varies | PromptTitle, ErrorTitle, Prompt, Error | XLUnicodeStrings: titles up to 32 characters, prompt up to 255, error message up to 225. |
| … | varies | formula1, formula2 | DVParsedFormula each: cce (2), 2 unused bytes, then the tokens. formula1 is the only bound, or the lower one for between; formula2 the upper bound, empty otherwise. |
| … | varies | sqref | SqRefU: the ranges validated (1 to 432). |
Sorting and AutoFilter
Sort (0x0090)
The last sort’s settings (2.4.263): 2 bytes of flags (bit 0 fCol, sort
columns left to right rather than rows; bits 1–3 fKey1Dsc to
fKey3Dsc, descending; bit 4 fCaseSensitive; bits 5–9
iOrder, the custom list used for the order; bit 10
fAltMethod, use phonetic text; 11–15 reserved); cchKey1,
cchKey2, cchKey3 (1 byte each); the three key strings
(XLUnicodeStringNoCch, present when their length is not 0); 1 reserved byte.
| Type | Record | Data |
|---|---|---|
0x009D | AutoFilterInfo | cEntries (2, 1 to 256): number of filtered columns; the AutoFilter records follow (2.4.8). The filtered range is the sheet’s _FilterDatabase name (built-in name 13). |
0x009B | FilterMode | No data: the sheet is filtered (2.4.119). |
AutoFilter (0x009E)
| Offset | Size | Field | Meaning |
|---|---|---|---|
0 | 2 | iEntry | Column, counted from the first column of _FilterDatabase. |
2 | 2 | flags | Bits 0–1 wJoin (0 the two conditions joined by AND, 1 by OR); 2, 3 fSimple1, fSimple2 (simple equality, blanks or non-blanks); 4 fTopN; 5 fTop (top rather than bottom items); 6 fPercent; 7–15 wTopN (1 to 500). |
4 | 10 | doper1 | First condition (AFDOper, below). |
14 | 10 | doper2 | Second condition. |
24 | varies | str1, str2 | The comparison strings (XLUnicodeStringNoCch) of string conditions, in order. |
An AFDOper (2.5.5) is vt (1),
grbitSign (1: 1 less than, 2 equal, 3 less or equal, 4 greater, 5 not
equal, 6 greater or equal) and 8 bytes of value. vt: 0 no condition; 2
an RK number (4 bytes, then 4 unused); 4 a double; 6 a string (4 unused bytes,
cch, fCompare = 0 when it holds ? or
* wildcards, a reserved and an unused byte; the text follows the
record’s fixed part); 8 a Boolean or error (2-byte Bes, then 6 unused); 12 all
blanks; 14 all non-blanks.
Scenarios
ScenMan (0x00AE, 2.4.246):
csct (2, number of scenarios); isctCur (2, the one selected
in the Scenario Manager, −1 none); isctShown (2, the one applied, −1
none); irefResult (2, 0 to 32); that many Ref8U result ranges. SCENARIO
records follow.
SCENARIO (0x00AF)
| Offset | Size | Field | Meaning |
|---|---|---|---|
0 | 2 | cref | Number of changing cells, 1 to 32. |
2 | 1 | fLocked | 1: cannot be changed while the workbook is protected. |
3 | 1 | fHidden | 1: hidden while the workbook is protected. |
4 | 1 × 3 | cchName, cchComment, cchNameUser | Lengths. |
7 | varies | rgchName | Scenario name (XLUnicodeStringNoCch). |
| … | varies | rgchNameUser, rgchComment | Author (up to 52 characters) and comment, XLUnicodeStrings, each absent when its length is 0. |
| … | 4 each | rgSLC | cref SLCO8 cell references: row (2) and column (2). |
| … | varies | rgst | cref XLUnicodeStrings, the values the scenario puts in those cells. |
| … | 2 × cref | unused |
Data consolidation and label ranges
DCon (0x0050, 2.4.82): four 2-byte fields:
iiftab, the function (0 average, 1 count numbers, 2 count, 3 maximum, 4
minimum, 5 product, 6 standard deviation of a sample, 7 standard deviation of the
population, 8 sum, 9 variance of a sample, 10 variance of the population);
fLeftCat (1: match rows by the labels in the left column, case
insensitively, else by position); fTopCat (the same for columns by the
top row); fLinkConsole (1: create links to the source data). The source
ranges follow as:
| Type | Record | Data |
|---|---|---|
0x0051 | DConRef | ref (6, RefU), cchFile (2, at least 2), stFile (a DConFile, below) and, for a reference to this workbook, 1 or 2 unused bytes (2.4.86). |
0x0052 | DConName | stName (XLNameUnicodeString, a defined name), cchFile (2; 0 for a workbook-level name in this file), stFile and the same unused bytes (2.4.85). |
0x01B5 | DConBin | nBuiltin (1, a built-in name: 0 Consolidate_Area, 1 Auto_Open, 2 Auto_Close, 3 Extract, 4 Database, 5 Criteria, 6 Print_Area, 7 Print_Titles, 8 Recorder, 9 Data_Form, 10 Auto_Activate, 11 Auto_Deactivate, 12 Sheet_Title, 13 _FilterDatabase); 2 + 1 reserved bytes; cchFile (2); stFile; unused bytes as above (2.4.83). |
0x015F | LRng | Label ranges for natural-language formulas: crefRw (2) and that many Ref8U row-label ranges, crefCol (2) and that many column-label ranges; together fewer than 1,028 (2.4.159). |
A DConFile (2.5.69) is an XLUnicodeStringNoCch holding the workbook, or workbook and sheet, in the encoded virtual-path form also used by external references, or a self-reference whose first character is 2. These records also name PivotTable source ranges.
Custom sheet data
BigName (0x0418, 2.4.18): a name and
value of custom data attached to the sheet: 2 reserved bytes
(0x1000), lcbData (4, size of the value),
cbName (1), the name in ANSI characters, then the value, carried on in
ContinueBigName records
(0x043C, each fewer than 8,225 bytes, 2.4.59).
Sorting and advanced AutoFilters
SortData (0x0895)
A sort over a range, written after a Sort-style FrtHeader (2.4.264). A future record:
frtHeader (12, rt = 0x0895), then a 2-byte flag word,
rfx (16, an RFX: the range to sort), cconditions (4),
idParent (4) and the sort conditions, each carried in its own
ContinueFrt12 record.
| Bits | Field | Meaning |
|---|---|---|
| 0 | fCol | 0 sort by rows, 1 sort by columns. |
| 1 | fCaseSensitive | 1 for a case-sensitive sort. |
| 2 | fAltMethod | 1 for a method other than character order, such as stroke order or Mandarin phonetic symbols. |
| 3–5 | sfp | The object holding the sort field: 0 a sheet, 1 a table, 2 an AutoFilter, 3 a query table. |
| 6–15 | unused | Ignore. |
cconditions is the number of sort conditions (one ContinueFrt12 record
each). idParent matters only when sfp is 1 (it equals
idList of the table’s TableFeatureType) or 3 (the zero-based index of
the Qsi record in the substream); otherwise ignore it.
SortCond12 (2.5.242)
| Size | Field | Meaning |
|---|---|---|
| 2 | flags | Bit 0 fSortDes (descending); bits 1–4 sortOn (the kind of sort, see below); bits 5–15 reserved. |
| 16 | rfx | The sort range of cells. |
| 8 | condData | A CondDataValue when sortOn is 0, 1 or 2; a CFFlag when it is 3. |
| 4 | cchSt | Signed character count of stSslist; 0 or more, and 0 unless sortOn is 0. |
| variable | stSslist | XLUnicodeStringNoCch: the custom sort list; present only when cchSt is greater than 0. |
The spec lists sortOn values 0, 1, 2 (condData is a CondDataValue) and 3
(a CFFlag) without naming them. CondDataValue (2.5.55) is condDataValue
(4: for sortOn 1 or 2 the zero-based index of a DXF record in the Globals
substream that gives the formatting; for 0 it is zero and ignored) and 4 reserved
zero bytes. CFFlag (2.5.31) is iIconSet (4, a KPISets value naming an icon
set) and iIcon (4, signed: -1 no icon, 0 to 4 the first to fifth icon of
the set), which changes the sort order of icon-set sorts.
AutoFilter12 (0x087E)
The advanced settings of one AutoFilter column (2.4.7). A future record with an
FrtRefHeader (rt = 0x087E, fFrtRef 1, the
range the filter covers).
| Size | Field | Meaning |
|---|---|---|
| 12 | frtRefHeader | FrtRefHeader. |
| 2 | iEntry | The column the filter applies to, counted from the first column of ref8; at most 255. |
| 4 | fHideArrow | Boolean: the drop-down arrow is hidden. |
| 4 | ft | Filter type, which also fixes the type of rgb: 0 none (then cCriteria or cDateGroupings is above zero), 1 filter by cell colour (rgb is a DXFN12NoCB), 2 filter by font colour (a DXFN12NoCB), 3 filter by cell icon (an AF12CellIcon). |
| 4 | cft | Custom filter type, below. |
| 4 | cCriteria | Number of rgCriteria items; ignored if ft is not 0. |
| 4 | cDateGroupings | Number of rgDateGroupings items; ignored if ft is not 0. |
| 2 | flags | Bits 0–2 reserved 0; bit 3 fWorksheetAutoFilter (1 for a sheet AutoFilter, which is exactly when idList is 0xFFFFFFFF); bits 4–15 unused. |
| 4 | unused2 | |
| 4 | idList | The idList of the table’s TableFeatureType, or 0xFFFFFFFF for a sheet AutoFilter. |
| 16 | guidSview | A GUID: 0, or the guid of the preceding UserSViewBegin record. |
| variable | rgb | By ft; absent for 0. |
| variable | rgCriteria | AF12Criteria array, present only if ft is 0 and cCriteria is not 0; each element in its own ContinueFrt12 record. |
| variable | rgDateGroupings | AF12DateInfo array, likewise by cDateGroupings. |
The flag word bit positions follow the order the spec lists the fields in (A, B, C
... from bit 0). cft values:
| Value | Custom filter shows |
|---|---|
0x00 | No custom filter |
0x01 | Items above average |
0x02 | Items below average |
0x08 to 0x0A | Tomorrow (8), today (9), yesterday (0x0A) |
0x0B to 0x0D | Next week, this week, last week |
0x0E to 0x10 | Next month, this month, last month |
0x11 to 0x13 | Next quarter, this quarter, last quarter |
0x14 to 0x16 | Next year, this year, last year |
0x17 | Year to date |
0x18 to 0x1B | The 1st to 4th quarter |
0x1C to 0x27 | The 1st to 12th month |
AF12Criteria (2.5.3): doper (10, an
AFDOper, the comparison) and str (an
XLUnicodeStringNoCch of length doper.vtValue.cch, present exactly when
doper.vt is 6). AF12DateInfo (2.5.4),
20 bytes: year (2), month (2, 1 to 12), day (4,
1 to 31), hour (2, 0 to 23), minute (2, 0 to 59),
second (2, 0 to 59), unused1 (2) and reserved1
(4, zero). AF12CellIcon (2.5.2):
iIconSet (4, a KPISets value) and iIcon (4): 0xFFFFFFFF for
KPINIL (no icon); 0 to 2 for the three-icon sets (arrows, grey arrows, flags, two
traffic-light sets, signs, symbols, symbols 2); 0 to 3 for the four-icon sets; 0 to 4
for the five-icon sets (arrows, grey arrows, rating, quarters).
Tables (lists)
An Excel table is a block starting at FeatHdr11, with one Feature11 (or Feature12) record per table, each followed by List12 records, then the table’s AutoFilter12 and SortData records.
FeatHdr11 (0x0871)
Common information for all tables on a sheet (2.4.113): frtHeader (12,
rt = 0x0871), isf (2, ISFLIST), reserved1 (1,
1), reserved2 (4, 0xFFFFFFFF), reserved3 (4, 0xFFFFFFFF), idListNext (4,
the next identifier to try for a new table) and reserved4 (2).
Feature11 (0x0872) and Feature12 (0x0878)
One table (2.4.114, 2.4.115). frtRefHeaderU (12, rt =
0x0872, or 0x0878 for Feature12, whose range is a Ref8U
covering the table), isf (2, ISFLIST), reserved1 (1, zero), reserved2
(4), cref2 (2, count of Ref8U in refs2),
cbFeatData (4, the size of rgbFeat; when 0, the record’s
size minus the size of refs2 minus 27 bytes), reserved3 (2),
refs2 (Ref8U array) and rgbFeat (a TableFeatureType).
Feature12 is the same record used for a table with properties that Feature11 cannot
hold: at least one of an lt of LTEXTERNALDATA, crwHeader and
fSingleCell both zero, or a column with fLoadTotalFmla or
fLoadTotalStr set. A Feature11 record must have none of these.
TableFeatureType (2.5.266)
| Size | Field | Meaning |
|---|---|---|
| 4 | lt | SourceType: 0 LTRANGE (a range), 1 LTSHAREPOINT (a read/write Web-based data provider list, cached in the List Data stream), 2 LTXML (XML mapper data, schema in the XML stream), 3 LTEXTERNALDATA (a query table). |
| 4 | idList | Identifier of the table; unique within the sheet. |
| 4 | crwHeader | Boolean: has a header row (must be 1 when fAutoFilter is 1; 0 when fSingleCell is 1). |
| 4 | crwTotals | Boolean: has a total row (0 when fSingleCell is 1). |
| 4 | idFieldNext | The next unique idField to assign to a column. |
| 4 | cbFSData | Size of the fixed part, from lt to rgbHashParam: always 64. |
| 2 | rupBuild | Build number of the writing application. |
| 2 | unused1 | |
| 4 | flags | See below. |
| 4 | lPosStmCache | Position of the cached data in the List Data stream (used only when lt is 1). |
| 4 | cbStmCache | Size in bytes of that cached data (lt 1). |
| 4 | cchStmCache | Characters of it when uncompressed (lt 1). |
| 4 | lem | LEMMode, the edit mode: 0 edit inline; 1 refresh first (a copy of a list table); 2 refresh first (caching a user change failed); 3 refresh first (undoing a cached change failed); 4 refresh first (the source could not be reconnected on load). Zero unless lt is 1. |
| 16 | rgbHashParam | Round-trip bytes: preserve them when lt is 1; ignore otherwise. |
| variable | rgbName | XLUnicodeString: the table name, unique in the workbook and case-sensitive. |
| 2 | cFieldData | Number of columns, 1 to 256. |
| variable | cSPName | XLUnicodeString: the cryptographic provider used for rgbHashParam; only if fLoadCSPName. |
| variable | entryId | XLUnicodeString: idList in decimal without leading zeros; only if fLoadEntryId (used when lt is 2). |
| variable | fieldData | Array of cFieldData Feat11FieldDataItem. |
| variable | idDeleted | Feat11RgSharepointIdDel; only if fLoadPldwIdDeleted. |
| variable | idChanged | Feat11RgSharepointIdChange; only if fLoadPldwIdChanged. |
| variable | cellInvalid | Feat11RgInvalidCells; only if fLoadPllstclInvalid. |
The 4-byte flag word, from bit 0: unused2; fAutoFilter (1; must be 1
when fPersistAutoFilter is); fPersistAutoFilter (the
AutoFilter is kept after a data refresh); fShowInsertRow (must be 1 if
fInsertRowInsCells); fInsertRowInsCells (rows below shift
down when the insert row shows); fLoadPldwIdDeleted;
fShownTotalRow (the total row was ever visible); reserved1 (0, bit 7);
fNeedsCommit (changes not synchronised; 0 unless lt is 1);
fSingleCell (bit 9; the table is one cell, with no header, total row or
extra columns; requires lt 2); reserved2 (bit 10);
fApplyAutoFilter (the filter is currently applied);
fForceInsertToBeVis (insert row forced visible because the table is
empty); fCompressedXml (the cached data is compressed; lt 1);
fLoadCSPName; fLoadPldwIdChanged (bit 15); bits 16 to 19
verXL (the application version that created the table: 0xB or 0xC);
bit 20 fLoadEntryId; 21 fLoadPllstclInvalid; 22
fGoodRupBld (rupBuild is valid); 23 unused3; 24
fPublished (ignored when fPublishedBookItems of
BookExt_Conditional12 is 0); bits 25 to 31 unused. The flags marked “0 unless
lt is 1” are zero for the other source types.
Feat11FieldDataItem (2.5.113)
One column of a table:
| Size | Field | Meaning |
|---|---|---|
| 4 | idField | Column identifier, non-zero and unique in the table. |
| 4 | lfdt | Web data provider type (0 unless lt is 1): 1 Text, 2 Number, 3 Boolean, 4 Date Time, 5 Note, 6 Currency, 7 Lookup, 8 Choice, 9 URL, 0x0A Counter, 0x0B Multiple Choices. |
| 4 | lfxidt | XML data type (0 unless lt is 2); a SOMITEM_ code, see below. |
| 4 | ilta | Total-row aggregate: 0 none, 1 Average, 2 Count, 3 Count Numbers, 4 Max, 5 Min, 6 Sum, 7 Standard Deviation, 8 Variance, 9 custom formula. |
| 4 | cbFmtAgg | Size of dxfFmtAgg. |
| 4 | istnAgg | Zero-based index of the Style record used for the total row; 0xFFFFFFFF for built-in table styles. |
| 4 | flags | Bit 0 fAutoFilter; 1 fAutoFilterHidden (needs fAutoFilter); 2 fLoadXmapi (rgXmap present; lt 2 only); 3 fLoadFmla (fmla present; lt 1 only); 4–5 unused; 6 reserved; 7 fLoadTotalFmla (totalFmla present; should be 1 when ilta is 9, else 0); 8 fLoadTotalArray (the total formula is an array formula); 9 fSaveStyleName (dskHdrCache.strStyleName present); 10 fLoadTotalStr (strTotal present; ilta must be 0); 11 fAutoCreateCalcCol (a calculated column; 0 when lt is 1); bits 12–31 unused. |
| 4 | cbFmtInsertRow | Size of dxfFmtInsertRow. |
| 4 | istnInsertRow | Style index for the insert row, or 0xFFFFFFFF. |
| variable | strFieldName | XLUnicodeString, 1 to 255 characters: the column name from the data source; unique when lt is 1 or 3. |
| variable | strCaption | XLUnicodeString, 1 to 255 characters, unique; equals the header cell text if there is a header row. Present only when fSingleCell is 0. Must not contain characters 0 to 31, an unpaired or reversed surrogate, or 0xFFFE, 0xFFFF, 0xF00B. |
| variable | dxfFmtAgg | DXFN12List: total-row format; present if cbFmtAgg is above 0. |
| variable | dxfFmtInsertRow | DXFN12List: insert-row format; present if cbFmtInsertRow is above 0. |
| variable | AutoFilter | Feat11FdaAutoFilter: present if fAutoFilter of the table is 1. |
| variable | rgXmap | Feat11XMap; if fLoadXmapi. |
| variable | fmla | Feat11Fmla; if fLoadFmla. |
| variable | totalFmla | Feat11TotalFmla; if fLoadTotalFmla. |
| variable | strTotal | XLUnicodeString, up to 32,767 characters: the total-row text; if fLoadTotalStr. |
| variable | wssInfo | Feat11WSSListInfo; present when lt is 1. |
| 4 | qsif | The idField of a Qsif record in the worksheet substream; present when lt is 3, greater than 0 and unique. |
| variable | dskHdrCache | CachedDiskHeader; present when the table’s crwHeader is 0 and fSingleCell is 0. |
lfxidt values (XML schema object model item types, [MSDN-SOM]):
0x1000 SCHEMA, 0x1001 ATTRIBUTE, 0x1002
ATTRIBUTEGROUP, 0x1003 NOTATION, 0x1100 IDENTITYCONSTRAINT,
0x1101 KEY, 0x1102 KEYREF, 0x1103 UNIQUE,
0x2000 ANYTYPE, 0x2100 DATATYPE, 0x2101 to
0x212D the datatypes in this order: ANYTYPE, ANYURI, BASE64BINARY,
BOOLEAN, BYTE, DATE, DATETIME, DAY, DECIMAL, DOUBLE, DURATION, ENTITIES, ENTITY,
FLOAT, HEXBINARY, ID, IDREF, IDREFS, INT, INTEGER, LANGUAGE, LONG, MONTH, MONTHDAY,
NAME, NCNAME, NEGATIVEINTEGER, NMTOKEN, NMTOKENS, NONNEGATIVEINTEGER,
NONPOSITIVEINTEGER, NORMALIZEDSTRING, NOTATION, POSITIVEINTEGER, QNAME, SHORT,
STRING, TIME, TOKEN, UNSIGNEDBYTE, UNSIGNEDINT, UNSIGNEDLONG, UNSIGNEDSHORT, YEAR,
YEARMONTH; 0x21FF DATATYPE_ANYSIMPLETYPE, 0x2200
SIMPLETYPE, 0x2400 COMPLEXTYPE, 0x4000 PARTICLE,
0x4001 ANY, 0x4002 ANYATTRIBUTE, 0x4003
ELEMENT, 0x4100 GROUP, 0x4101 ALL, 0x4102
CHOICE, 0x4103 SEQUENCE, 0x4104 EMPTYPARTICLE,
0x0800 NULL, 0x2800 NULL_TYPE, 0x4801
NULL_ANY, 0x4802 NULL_ANYATTRIBUTE, 0x4803 NULL_ELEMENT
(each name is prefixed SOMITEM_).
Structures inside a column
| Structure | Layout |
|---|---|
| Feat11FdaAutoFilter (2.5.112) | cbAutoFilter (4, at most 2,080), unused (2), recAutoFilter: an AutoFilter structure (the same layout as the AutoFilter record, see above). |
| Feat11Fmla (2.5.114) | cbFmla (2), rgbFmla: a ListParsedFormula, the column formula applied to every row but the header and total. |
| Feat11TotalFmla (2.5.118) | rgbFmlaTotal: a ListParsedArrayFormula when fLoadTotalArray is 1, else a ListParsedFormula. |
| Feat11RgInvalidCells (2.5.115) | cCellInvalid (2) and that many Feat11CellStruct: idxRow (4, a row identifier from the table column named “ID”) and idxField (4, an idField of the table). |
| Feat11RgSharepointIdChange, Feat11RgSharepointIdDel (2.5.116, 2.5.117) | cId (2) and that many 4-byte row identifiers of modified, or deleted, rows (they match the LISTDATA row identifiers). |
| Feat11XMap (2.5.120) | iXmapMac (2, at most 1) and that many Feat11XMapEntry. |
| Feat11XMapEntry, Feat11XMapEntry2 (2.5.121, 2.5.122) | 4 bytes of flags (bit 0 reserved; bit 1 fLoadXMap always 1; bit 2 fCanBeSingle: the XPath selects one node (1) or a collection (0); bit 3 reserved; 28 bits reserved), then dwMapId (4, the ID of a Map element in the XML stream) and rgbXPath (XLUnicodeString, under 32,000 characters). |
| CachedDiskHeader (2.5.17) | cbdxfHdrDisk (4), rgHdrDisk (a DXFN12List: the heading format), strStyleName (XLUnicodeString, a user or built-in style name applied first; only if fSaveStyleName). |
Feat11WSSListInfo (2.5.119)
The link between a column and a Web data provider list (lt 1).
LCID (4), cDec (4, decimal places); then 4 bytes of flags
from bit 0: fPercent, fDecSet (fixed decimal point at
cDec), fDateOnly, fReadingOrder (2 bits: 0 by
surrounding cells, 1 left to right, 2 right to left), fRichText,
fUnkRTFormatting, fAlertUnkRTFormatting, 24 bits unused;
then 4 bytes: fReadOnly, fRequired, fMinSet,
fMaxSet (the limits are stored in the List Data stream), fDefaultSet,
fDefaultDateToday, fLoadFormula, fAllowFillIn
(a choice field allows custom entries), bDefaultType (8 bits: 0 none, 1
string, 2 Boolean, 3 number; ignored unless fDefaultSet), 16 bits unused;
then rgbDV (the default value, typed by the column’s lfdt:
an XLUnicodeString of at most 255 characters for Text, Choice and Multiple Choices; an
Xnum for Number and Currency; a 32-bit Boolean for Boolean; a DateAsNum for Date Time;
absent for Note, Lookup, URL and Counter), strFormula (XLUnicodeString,
the provider’s validation formula, only if fLoadFormula) and 4 reserved
zero bytes.
List12 (0x0877)
Extra formatting for a table, following its Feature11 or Feature12 (2.4.157):
frtHeader (12, rt = 0x0877), lsd
(2: 0 the data is a List12BlockLevel, 1 a List12TableStyleClientInfo, 2 a
List12DisplayName), idList (4, non-zero, the table’s idList)
and rgb.
| Structure | Layout |
|---|---|
| List12BlockLevel (2.5.174) | Default formats applied when the table grows, style first and then the DXFN12List. 4-byte signed fields: cbdxfHeader, istnHeader (index of a Style record for header cells, -1 for none), cbdxfData, istnData, cbdxfAgg, istnAgg (total row), cbdxfBorder, cbdxfHeaderBorder, cbdxfAggBorder. Then, each present only if its count is non-zero: dxfHeader, dxfData, dxfAgg (DXFN12List), dxfBorder (a DXFN12), dxfHeaderBorder, dxfAggBorder (DXFN12List); then stHeader, stData, stAgg (XLUnicodeString style names, each present only if the matching istn is not -1). |
| List12TableStyleClientInfo (2.5.176) | 2 bytes of flags: bit 0 fFirstColumn (apply table style elements of tseType 3), 1 fLastColumn (4), 2 fRowStripes (5 and 6), 3 fColumnStripes (7 and 8), 4–5 unused, 6 fDefaultStyle, 7–15 unused; then stListStyleName (XLUnicodeString, 1 to 255 characters; for a custom style the rgchName of a TableStyle record). |
| List12DisplayName (2.5.175) | stListName (XLNameUnicodeString: empty when rgbName of the TableFeatureType is not empty; else the case-insensitive unique name among table and defined names) and stListComment (XLUnicodeString). |
See TableStyle and DXFN12 on the styles page.
Sheet protection
| Type | Record | Data |
|---|---|---|
0x0063 | ObjProtect | fLockObj (2, always 1): the sheet is protected and so are its objects (2.4.183). |
0x00DD | ScenarioProtect | fScenProtect (2, Boolean): scenarios are protected (2.4.245). |
0x0098 | LPr | Unused: 2 bytes of flags (all unused or reserved), five unused 2-byte fields and unused bytes to the end (2.4.158). |
The sheet’s own Protect and Password records are described on workbook settings.