XLSX is SpreadsheetML, the spreadsheet language of Office Open XML, standardised as ECMA-376 and ISO/IEC 29500. Part 1 of the standard defines the markup (SpreadsheetML is its chapter 18) and Part 2 the Open Packaging Conventions (OPC) container. The same package is described for Word on the DOCX package page; this page covers what is particular to workbooks.
The container
- A ZIP archive (deflate or stored).
[Content_Types].xmlat the root gives each part’s content type, by file extension (Default) or by part name (Override)._rels/.relsholds the package relationships; a part’s own relationships are in_rels/name.relsbeside it. Each relationship has anId(such asrId1), aTypeURI and aTarget, and parts refer to each other by those ids.- The package relationship of type
http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocumentpoints to the workbook, normallyxl/workbook.xml. Part names are only a convention; readers must follow relationships.
Workbook parts
Content types start application/vnd.openxmlformats-officedocument.spreadsheetml.
unless shown in full; relationship types start
http://schemas.openxmlformats.org/officeDocument/2006/relationships/.
| Part (usual name) | Content type | Relationship |
|---|---|---|
Workbook (xl/workbook.xml) | …sheet.main+xml; template …template.main+xml; macro-enabled application/vnd.ms-excel.sheet.macroEnabled.main+xml (.xlsm) | officeDocument |
Worksheet (xl/worksheets/sheet1.xml) | …worksheet+xml | worksheet |
| Chart sheet | …chartsheet+xml | chartsheet |
| Dialog sheet | …dialogsheet+xml | dialogsheet |
Shared strings (xl/sharedStrings.xml) | …sharedStrings+xml | sharedStrings |
Styles (xl/styles.xml) | …styles+xml | styles |
Theme (xl/theme/theme1.xml) | application/vnd.openxmlformats-officedocument.theme+xml | theme |
| Calculation chain | …calcChain+xml | calcChain |
| Comments | …comments+xml | comments |
| Table | …table+xml | table |
| PivotTable, PivotCache definition, PivotCache records | …pivotTable+xml, …pivotCacheDefinition+xml, …pivotCacheRecords+xml | pivotTable, pivotCacheDefinition, pivotCacheRecords |
| External workbook link | …externalLink+xml | externalLink |
| Query table, connections | …queryTable+xml, …connections+xml | queryTable, connections |
Drawing (xl/drawings/drawing1.xml), chart | application/vnd.openxmlformats-officedocument.drawing+xml, …drawingml.chart+xml | drawing, chart |
Core, extended and custom properties (docProps/) | application/vnd.openxmlformats-package.core-properties+xml, …officedocument.extended-properties+xml, …officedocument.custom-properties+xml | package relationships |
VBA project (xl/vbaProject.bin, .xlsm only) | application/vnd.ms-office.vbaProject | http://schemas.microsoft.com/office/2006/relationships/vbaProject |
Further parts hold metadata, single-cell tables, revision logs, user names, volatile dependencies, custom XML mappings and printer settings.
workbook.xml
The root element is workbook in the namespace
http://schemas.openxmlformats.org/spreadsheetml/2006/main (the
transitional schema that Excel writes; the strict schema uses
http://purl.oclc.org/ooxml/spreadsheetml/main). Its children, in order:
| Element | Holds |
|---|---|
fileVersion | Application that wrote the file and its version numbers. |
fileSharing | Read-only recommendation and write-protection password. |
workbookPr | Workbook options; date1904="1" switches to the 1904 date system. |
workbookProtection | Structure and window protection. |
bookViews | Window positions and the active sheet (workbookView). |
sheets | One sheet per sheet, in tab order: name, sheetId (unique number), state (visible, hidden, veryHidden) and r:id, the relationship to the sheet’s part. |
functionGroups | Function categories. |
externalReferences | Relationships to external link parts. |
definedNames | definedName elements: a name, an optional localSheetId scope, hidden, and the formula as text. Built-in names start _xlnm., such as _xlnm.Print_Area. |
calcPr | Calculation settings: calcId, calcMode (manual, auto, autoNoTable), fullCalcOnLoad, iteration, reference style. |
oleSize, customWorkbookViews, pivotCaches, smartTagPr, smartTagTypes, webPublishing, fileRecoveryPr, webPublishObjects, extLst | Embedding size, custom views, PivotCache list, smart tags, web publishing, recovery and extensions. |