Open pallxk opened 1 year ago
Do you know where that workbook is coming from? Was it generated by Excel or some other application?
I'd have to recheck it, but I don't think this is valid per the MS-XLSB spec, so it could be a bug in the data reader or it could just genuinely be a corrupted file.
I believe It's generated/created with Excel and edited with it but I'm not sure how it evolves into that state.
Opening the file with MS Excel will not report any error. I'm not familiar with MS-XLSB spec, but I fully understand your concern on this. I'm still trying to understand how an xlsb can be modified with Excel into such a state. I'll share once I've found out the reproducing steps or got files that I'm allowed to share.
When a workbook contains sheet with rId being None,
open_workbook
throwsKeyError(None)
.Related code: https://github.com/willtrnr/pyxlsb/blob/7dca9403f61a71ca4ca53cad4330ce068cef4dbd/pyxlsb/workbook.py#L43-L47
And some debug output:
(I've masked all sheet names with values as
'*'
.)For now, I don't know how to recreate such a *.xlsb file from scratch, and can't share the file I have due to confidentiality reasons. Hopefully the debug output is enough for anyone interested to identify the problem.