- 单元格样式过多
The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook
- 场景:多个sheet页格式表头格式不一致,为了美观,偷懒给每个单元格都定义了一个样式
- 原因:Excel最多定义64000个样式,所以当达到64000个样式的时候就会抛出异常
- 解决方案:除了表头,其余单元格都不定义样式
- 注意:尽量别把定义样式的代码写进for循环中
The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook