You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
xlsx: workbooks with an Excel 4.0 macro sheet fail to open #802
so none of the workbook's worksheets can be read either.
Xlsx::read_workbook maps the last segment of each sheet's relationship type and accepts only worksheet, chartsheet, and dialogsheet. A macro sheet is related with http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet, and an international macro sheet with http://schemas.microsoft.com/office/2006/relationships/xlIntlMacrosheet. SheetType::MacroSheet already exists, so both could map to it and show up in sheets_metadata() like chart and dialog sheets do.
Reproduced with 0.38.0 and master (27b2458). A minimal package with one worksheet and one macro sheet is enough. Its main part uses the application/vnd.ms-excel.sheet.macroEnabled.main+xml content type, and the macro sheet has an application/vnd.ms-excel.macrosheet+xml override. These are the relevant parts:
I built the repro from these parts by hand because I don't have Excel available, and I can attach that .xlsm. An Excel-saved workbook (Insert > MS Excel 4.0 Macro) would make a better test file.
I made a test file with Excel for Mac (16.115): a Data worksheet, an Excel 4.0 macro sheet Macro1 (=ECHO(FALSE), =RETURN()) and an international macro sheet Intl1 (=RETURN()). It's saved as .xlsm, .xlsb and .xls: macro_sheet.zip
.xlsb fails the same way: Unrecognized BoundSheet8:dt: xl/macrosheets/sheet1.bin. Xlsb::new only accepts sheet paths under worksheets, chartsheets and dialogsheets.
.xls already works. Macro1 and Intl1 are SheetType::MacroSheet, and their cells and formulas read correctly.
Mapping xlMacrosheet and xlIntlMacrosheet (xlsx) and the macrosheets path (xlsb) to SheetType::MacroSheet is enough. With that change, the .xlsm and .xlsb give the same sheets, values and formulas as the .xls. Excel saves both kinds of macro sheet under xl/macrosheets/ (sheet1.xml and intlsheet1.xml). Feel free to use these files as the test file.
Thanks for the files and the analysis. I opened #803 with that change for xlsx and xlsb. It uses your three files, unedited, as tests/macro_sheets.{xlsm,xlsb,xls}, and checks that each format gives the same sheets, values and formulas.
Activity
Alex-ley-scrub commentedon Nov 14, 2026
I made a test file with Excel for Mac (16.115): a
Dataworksheet, an Excel 4.0 macro sheetMacro1(=ECHO(FALSE),=RETURN()) and an international macro sheetIntl1(=RETURN()). It's saved as .xlsm, .xlsb and .xls: macro_sheet.zipOn master (27b2458):
.xlsm:Unrecognized sheet:type: xl/macrosheets/sheet1.xml.xlsbfails the same way:Unrecognized BoundSheet8:dt: xl/macrosheets/sheet1.bin.Xlsb::newonly accepts sheet paths underworksheets,chartsheetsanddialogsheets..xlsalready works.Macro1andIntl1areSheetType::MacroSheet, and their cells and formulas read correctly.Mapping
xlMacrosheetandxlIntlMacrosheet(xlsx) and themacrosheetspath (xlsb) toSheetType::MacroSheetis enough. With that change, the .xlsm and .xlsb give the same sheets, values and formulas as the .xls. Excel saves both kinds of macro sheet underxl/macrosheets/(sheet1.xmlandintlsheet1.xml). Feel free to use these files as the test file.NazarKalytiuk commentedon Nov 15, 2026
Thanks for the files and the analysis. I opened #803 with that change for xlsx and xlsb. It uses your three files, unedited, as
tests/macro_sheets.{xlsm,xlsb,xls}, and checks that each format gives the same sheets, values and formulas.