2017-04-01 07:32:12 +00:00
|
|
|
#### Worksheet Object
|
2017-03-31 21:46:02 +00:00
|
|
|
|
|
|
|
In addition to the base sheet keys, worksheets also add:
|
|
|
|
|
|
|
|
- `ws['!cols']`: array of column properties objects. Column widths are actually
|
|
|
|
stored in files in a normalized manner, measured in terms of the "Maximum
|
|
|
|
Digit Width" (the largest width of the rendered digits 0-9, in pixels). When
|
|
|
|
parsed, the column objects store the pixel width in the `wpx` field, character
|
|
|
|
width in the `wch` field, and the maximum digit width in the `MDW` field.
|
|
|
|
|
2017-04-28 07:28:03 +00:00
|
|
|
- `ws['!rows']`: array of row properties objects as explained later in the docs.
|
|
|
|
Each row object encodes properties including row height and visibility.
|
|
|
|
|
2017-03-31 21:46:02 +00:00
|
|
|
- `ws['!merges']`: array of range objects corresponding to the merged cells in
|
2017-09-24 23:40:09 +00:00
|
|
|
the worksheet. Plain text formats do not support merge cells. CSV export
|
2017-03-31 21:46:02 +00:00
|
|
|
will write all cells in the merge range if they exist, so be sure that only
|
|
|
|
the first cell (upper-left) in the range is set.
|
|
|
|
|
2020-11-20 07:05:27 +00:00
|
|
|
- `ws['!outline']`: configure how outlines should behave. Options default to
|
|
|
|
the default settings in Excel 2019:
|
|
|
|
|
|
|
|
| key | Excel feature | default |
|
|
|
|
|:----------|:----------------------------------------------|:--------|
|
|
|
|
| `above` | Uncheck "Summary rows below detail" | `false` |
|
|
|
|
| `left` | Uncheck "Summary rows to the right of detail" | `false` |
|
|
|
|
|
2017-04-28 07:28:03 +00:00
|
|
|
- `ws['!protect']`: object of write sheet protection properties. The `password`
|
2017-04-26 02:27:12 +00:00
|
|
|
key specifies the password for formats that support password-protected sheets
|
|
|
|
(XLSX/XLSB/XLS). The writer uses the XOR obfuscation method. The following
|
2017-04-28 07:28:03 +00:00
|
|
|
keys control the sheet protection -- set to `false` to enable a feature when
|
|
|
|
sheet is locked or set to `true` to disable a feature:
|
|
|
|
|
2017-04-30 20:37:53 +00:00
|
|
|
<details>
|
2017-09-24 23:40:09 +00:00
|
|
|
<summary><b>Worksheet Protection Details</b> (click to show)</summary>
|
2017-04-30 20:37:53 +00:00
|
|
|
|
2017-04-28 07:28:03 +00:00
|
|
|
| key | feature (true=disabled / false=enabled) | default |
|
|
|
|
|:----------------------|:----------------------------------------|:-----------|
|
|
|
|
| `selectLockedCells` | Select locked cells | enabled |
|
|
|
|
| `selectUnlockedCells` | Select unlocked cells | enabled |
|
|
|
|
| `formatCells` | Format cells | disabled |
|
|
|
|
| `formatColumns` | Format columns | disabled |
|
|
|
|
| `formatRows` | Format rows | disabled |
|
|
|
|
| `insertColumns` | Insert columns | disabled |
|
|
|
|
| `insertRows` | Insert rows | disabled |
|
|
|
|
| `insertHyperlinks` | Insert hyperlinks | disabled |
|
|
|
|
| `deleteColumns` | Delete columns | disabled |
|
|
|
|
| `deleteRows` | Delete rows | disabled |
|
|
|
|
| `sort` | Sort | disabled |
|
|
|
|
| `autoFilter` | Filter | disabled |
|
|
|
|
| `pivotTables` | Use PivotTable reports | disabled |
|
|
|
|
| `objects` | Edit objects | enabled |
|
|
|
|
| `scenarios` | Edit scenarios | enabled |
|
2017-04-30 20:37:53 +00:00
|
|
|
</details>
|
2017-04-04 18:41:11 +00:00
|
|
|
|
2017-04-10 05:10:54 +00:00
|
|
|
- `ws['!autofilter']`: AutoFilter object following the schema:
|
|
|
|
|
|
|
|
```typescript
|
|
|
|
type AutoFilter = {
|
2017-04-26 02:27:12 +00:00
|
|
|
ref:string; // A-1 based range representing the AutoFilter table range
|
2017-04-10 05:10:54 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2017-04-01 07:32:12 +00:00
|
|
|
#### Chartsheet Object
|
2017-03-27 21:35:15 +00:00
|
|
|
|
2017-03-31 21:46:02 +00:00
|
|
|
Chartsheets are represented as standard sheets. They are distinguished with the
|
|
|
|
`!type` property set to `"chart"`.
|
2017-03-27 21:35:15 +00:00
|
|
|
|
2017-03-31 21:46:02 +00:00
|
|
|
The underlying data and `!ref` refer to the cached data in the chartsheet. The
|
|
|
|
first row of the chartsheet is the underlying header.
|
2017-03-27 21:35:15 +00:00
|
|
|
|
2017-10-02 08:15:36 +00:00
|
|
|
#### Macrosheet Object
|
|
|
|
|
|
|
|
Macrosheets are represented as standard sheets. They are distinguished with the
|
|
|
|
`!type` property set to `"macro"`.
|
|
|
|
|
|
|
|
#### Dialogsheet Object
|
|
|
|
|
|
|
|
Dialogsheets are represented as standard sheets. They are distinguished with the
|
|
|
|
`!type` property set to `"dialog"`.
|
|
|
|
|