Repository navigation
xlsx/xlsb: read Excel 4.0 macro sheets - #803
Open
NazarKalytiuk wants to merge 1 commit into
Open
NazarKalytiuk wants to merge 1 commit into
NazarKalytiuk wants to merge 1 commit into
Conversation
Fixed issue where a workbook with an Excel 4.0 macro sheet or an international macro sheet failed to open. Xlsx rejected the xlMacrosheet and xlIntlMacrosheet relationships with "Unrecognized sheet:type", and Xlsb rejected sheets under xl/macrosheets/ with "Unrecognized BoundSheet8:dt". Both now report SheetType::MacroSheet, as Xls already does, and their cells and formulas read like those of the .xls file. Fixes tafia#802 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed issue where a workbook with an Excel 4.0 macro sheet or an international macro sheet failed to open.
Xlsxmaps thexlMacrosheetandxlIntlMacrosheetrelationship types toSheetType::MacroSheet. Before, it rejected the whole workbook withUnrecognized sheet:type: xl/macrosheets/sheet1.xml.Xlsbmaps sheet paths underxl/macrosheets/toSheetType::MacroSheet. Before, it rejected the workbook withUnrecognized BoundSheet8:dt: xl/macrosheets/sheet1.bin.Xlsalready reports these sheets asSheetType::MacroSheet. With this change, all three formats give the same sheets, values and formulas. The cell readers needed no changes: both read the cells of a macro sheet the same way as a worksheet.Related issue
Fixes #802
Testing
test_all_macro_sheetsreadstests/macro_sheets.{xlsm,xlsb,xls}. Each file is the same workbook: aDataworksheet, an Excel 4.0 macro sheetMacro1(=ECHO(FALSE),=RETURN()) and an international macro sheetIntl1(=RETURN()). @Alex-ley-scrub saved the files with Excel for Mac 16.115 and attached them to #802, unedited. For each format, the test checks the sheet metadata and the values and formulas of both macro sheets. Without the fix, the xlsm and xlsb cases fail with the errors above, and the xls case passes.Checklist
cargo test --all-featurespasses.cargo fmt -- --checkpasses.cargo clippy --all-targets --all-features -- -Dwarningspasses.cargo +1.88 check --all-featuresandcargo check --target wasm32-unknown-unknown --all-featuresalso pass. I didn't runtyposlocally.🤖 Generated with Claude Code