Bug 118668 - FILEOPEN: Librecalc doesn't show all sheets in XLSX modified with exceljs
Summary: FILEOPEN: Librecalc doesn't show all sheets in XLSX modified with exceljs
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low normal
Assignee: Markus Mohrhard
URL:
Whiteboard: target:26.2.0 target:25.8.1
Keywords: filter:xlsx
Depends on:
Blocks: XLSX-External-Generators
  Show dependency treegraph
 
Reported: 2018-07-10 14:37 UTC by Ilya Zubakin
Modified: 2025-08-08 18:01 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
buggy file (26.13 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-07-10 14:38 UTC, Ilya Zubakin
Details
Second sheet displayed in MSO Excel (8.64 KB, image/png)
2018-07-11 09:39 UTC, Xisco Faulí
Details
Source file (32.08 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-07-12 14:13 UTC, Ilya Zubakin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Zubakin 2018-07-10 14:37:53 UTC
Description:
Librecalc doesn't find the second sheet in the workbook.

Steps to Reproduce:
1. Open attached file 


Actual Results:
You can't find the second sheet.

Expected Results:
You can find the second sheet


Reproducible: Always


User Profile Reset: No



Additional Info:
Gnumeric opens this file well.
Comment 1 Ilya Zubakin 2018-07-10 14:38:39 UTC
Created attachment 143426 [details]
buggy file
Comment 2 Mike Kaganski 2018-07-10 14:51:14 UTC
Reproducible using Version: 6.1.0.1 (x64)
Build ID: 378e26bd4f22a135cef5fa17afd5d4171d8da21a
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: ru-RU (ru_RU); Calc: CL

Specifically: when opening in LibreOffice, the second sheet is hidden, and available in menu Sheet→Show Sheet...

In Excel 2013, both sheets are visible right away.
Comment 3 Ilya Zubakin 2018-07-10 14:55:08 UTC Comment hidden (obsolete)
Comment 4 Mike Kaganski 2018-07-10 15:04:01 UTC Comment hidden (obsolete)
Comment 5 Xisco Faulí 2018-07-11 09:39:24 UTC
Created attachment 143449 [details]
Second sheet displayed in MSO Excel
Comment 6 Xisco Faulí 2018-07-11 09:40:35 UTC
Also reproducible in


Version: 4.3.0.0.alpha1+
Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 7 Timur 2018-07-11 15:05:53 UTC
If buggy XLSX is saved in MSO 2013 or 2016, than LO opens both sheets.
Comment 8 Timur 2018-07-11 15:24:30 UTC
sheet2.xml from attached xlsx:
<sheetView workbookViewId="0" zoomScale="200" zoomScaleNormal="23" view="pageBreakPreview">
			<selection activeCell="T9" sqref="T9"/>
</sheetView>

sheet2.xml from saved xlsx:
<sheetView tabSelected="1" view="pageBreakPreview" zoomScale="200" zoomScaleNormal="23" workbookViewId="0">
			<selection activeCell="T9" sqref="T9"/>
</sheetView>

tabSelected="1" is missing in original xlsx.

If more than one SheetView.TabSelected is set to true, it looks like Excel just picks the first one. Maybe also the same if it's missing from all sheets, like with attached xlsx.

Ilya, please describe how the spreadsheet was generated, e.g. Excel (which version) and how it was manually modified with which software.
Comment 9 Ilya Zubakin 2018-07-12 14:12:15 UTC
This spreadsheet was saved with MSO 2016 then modified with exceljs v1.5.1 (https://github.com/guyonroche/exceljs/). 
I modified it with older version exceljs and all works fine for me.

Thanks for your help. I am going to open the issue in exceljs project.

By the way, Calc opens the source file without this problem.
Comment 10 Ilya Zubakin 2018-07-12 14:13:44 UTC
Created attachment 143520 [details]
Source file
Comment 11 Mike Kaganski 2018-07-12 14:49:50 UTC
(In reply to Timur from comment #8)

If it is the tabSelected attribute that causes this, then we have a bug with that. The attribute is used to indicate (possibly multiple) selection of sheets, not their visibility. And it is optional (according to ECMA-376-1:2016).

Anyway, this is a proper bug report, which shouldn't be closed until fixed.
Comment 12 Timur 2018-12-27 18:35:01 UTC
(In reply to Ilya Zubakin from comment #9)
>I am going to open the issue in exceljs project.
Please link. I found https://github.com/guyonroche/exceljs/issues/630 and https://github.com/guyonroche/exceljs/issues/648.
Not sure anymore this is a bug.
Comment 13 QA Administrators 2020-12-27 03:36:25 UTC Comment hidden (obsolete, spam)
Comment 14 QA Administrators 2023-07-15 03:13:13 UTC Comment hidden (obsolete)
Comment 15 Markus Mohrhard 2025-07-19 07:37:07 UTC
This is an exceljs bug (https://github.com/exceljs/exceljs/issues/678) as it was writing the entry "show" instead of the expected "visible" for the state attribute on the sheet element

We can still handle this more in line with what Excel does.
Comment 16 Commit Notification 2025-07-19 10:19:44 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/098a900142491477223e3340f29a15505efe99cc

tdf#118668: handle wrong XLSX sheet visibility settings in line with Excel

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2025-08-07 08:21:48 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/0a7db57656df704bfed869f743c8669b29d0eebd

tdf#118668: handle wrong XLSX sheet visibility settings in line with Excel

It will be available in 25.8.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 Commit Notification 2025-08-08 18:01:42 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e485e76d5e51e86e8e2d14067f0433e9b0d9dda9

tdf#118668: subsequent_filters_test5: Add test

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.