2017-03-31 18:46:42 +00:00
|
|
|
#### Sheet Visibility
|
|
|
|
|
|
|
|
Excel enables hiding sheets in the lower tab bar. The sheet data is stored in
|
|
|
|
the file but the UI does not readily make it available. Standard hidden sheets
|
2017-09-24 23:40:09 +00:00
|
|
|
are revealed in the "Unhide" menu. Excel also has "very hidden" sheets which
|
2017-03-31 18:46:42 +00:00
|
|
|
cannot be revealed in the menu. It is only accessible in the VB Editor!
|
|
|
|
|
2017-04-30 20:37:53 +00:00
|
|
|
The visibility setting is stored in the `Hidden` property of sheet props array.
|
|
|
|
|
|
|
|
<details>
|
2017-09-24 23:40:09 +00:00
|
|
|
<summary><b>More details</b> (click to show)</summary>
|
2017-03-31 18:46:42 +00:00
|
|
|
|
|
|
|
| Value | Definition |
|
|
|
|
|:-----:|:------------|
|
|
|
|
| 0 | Visible |
|
|
|
|
| 1 | Hidden |
|
|
|
|
| 2 | Very Hidden |
|
|
|
|
|
2021-04-08 18:21:37 +00:00
|
|
|
With <https://rawgit.com/SheetJS/test_files/HEAD/sheet_visibility.xlsx>:
|
2017-03-31 18:46:42 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
> wb.Workbook.Sheets.map(function(x) { return [x.name, x.Hidden] })
|
|
|
|
[ [ 'Visible', 0 ], [ 'Hidden', 1 ], [ 'VeryHidden', 2 ] ]
|
|
|
|
```
|
|
|
|
|
|
|
|
Non-Excel formats do not support the Very Hidden state. The best way to test
|
2017-04-02 06:47:25 +00:00
|
|
|
if a sheet is visible is to check if the `Hidden` property is logical truth:
|
2017-03-31 18:46:42 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
> wb.Workbook.Sheets.map(function(x) { return [x.name, !x.Hidden] })
|
|
|
|
[ [ 'Visible', true ], [ 'Hidden', false ], [ 'VeryHidden', false ] ]
|
|
|
|
```
|
2017-04-30 20:37:53 +00:00
|
|
|
</details>
|
2017-03-31 18:46:42 +00:00
|
|
|
|