Error in /xl/styles.xml-Part caused by Table Style (Reproducable)
See original GitHub issueRead and complete the full issue template
Do you want to request a feature or report a bug?
- Bug
- Feature
- Question
Did you test against the latest CI build?
- Yes
- No
Version of ClosedXML
.0.95.999.2326
What is the current behavior?
Copying a worksheet will give an error as above
(Repaired Records: Table Style from /xl/styles.xml part (Styles)
)
What is the expected behavior or new feature?
No error
Is this a regression from the previous version? Yes: v0.95.4 bug v0.95.3 bug v0.94.2 bug v0.93.1 bug v0.92.1 working
Reproducibility
Always:
- Choose “Format as table”
- Add new Table Style
- Set “Whole Table” to “No Borders”
- Copy a sheet with ClosedXML an save it
- Open with Excel and get the above error
Code to reproduce problem:
static void Main(string[] args) {
File.Copy("test.xlsx", "copy.xlsx", true);
using XLWorkbook wb = new("copy.xlsx");
bool res = wb.TryGetWorksheet("Original", out IXLWorksheet sheet);
sheet = sheet.CopyTo(wb, "copy");
wb.Save();
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Repaired Records: Format from /xl/styles.xml part
Yes, this error indicates some format in the workbook make the content unreadable, and Excel has tried to repair the format. After this...
Read more >Style from /xl/styles.xml part (styles) Undreadable Content
After clicking Yes, then another error appeared saying: "Excel was able to open teh file by repairing or removing the unreadable content. Removed...
Read more >Apache POI Excel styles problem when creating two or ...
The problem was that while the font was written into a private class variable and reused afterwards, the important part that was missing...
Read more >Reading Excel Files-- Styles.xml error
It's possible they have a bad formula, and the style.xml was removed from the file. That Excel file maybe corrupt.Also, there are no...
Read more >openxlsx loadworkbook
Removed Part: /xl/styles.xml part with XML error. colNames If TRUE, the first row of data will ... I had a custom table style...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not any concrete plans. Priority ATM is to deal with PRs.
Just encountered a similar (if not the same) bug on the latest version (0.101.0) Just having any custom table style “corrupts” the worksheet when saving again:
The excel file Test.xlsx is completly empty except a single custom table style. Maybe this helps whenever somebody finds some time to look into this issue.