Created attachment 32796 [details] java code Amount of CellStyles is still limited to 32K. When you create large enough excel file, after reaching value of 32767 of CellStyles, next CellStyleID becomes negative (-32768). Related bug # 57880 - for version 3.11 final. And it has not been fixed in the version 3.12 final, despite it is written in the release notes. See attached java code and resulting xlsx file (what happens from the row 10923). Same limit applies to Fonts. PS: increasing limit to 64K is not a solution! Styles are stored in the ArrayList, and max size of it is MAX_INTEGER, which is 2,147,483,647
Created attachment 32797 [details] Resulting xlsx file
FYI, the general case up to 64k styles is fixed via bug 58260 now, it is not possible to support more than 64k of these because Excel itself limits the number of styles, files with more will be reported as corrupt by Excel! Also note the comments about proper re-using of styles in bug 58260, due to this usually not makes sense to have so many Fonts/Styles in the first place as you should re-use the created objects as much as possible! I am closing this as DUPLICATE for now, please try with an upcoming nightly build or version 3.13-beta2 as soon as it becomes available and reopen the bug if this is still a problem for you. *** This bug has been marked as a duplicate of bug 58260 ***