`Workbook._named_styles['Normal'].number_format` behave strangely.
Created originally on Bitbucket by soundlake (Sinyeol An)
The sample code
#!python
from openpyxl import Workbook
from openpyxl.styles.numbers import FORMAT_TEXT
wb = Workbook()
wb._named_styles['Normal'].number_format = FORMAT_TEXT
wb.save('hello.xlsx')
The expected behavior
- The "Normal" named style's number format is set to "@" (text format)
- All the cells' number format is set to "@" (text format)
The current behavior
- [O] The "Normal" named style's number format is set to "@" (text format)
-
All the cells' number format is set to "@" (text format) - It seems to break the relationship between all cells and the "Normal" style.
- If a cell or a range of cells are set to another style then re-set to this "Normal" style, then the cell's or cells' number format changes into "@" (text format).
- If you didn't try the previous procedure to re-connect cells with this "Normal" style, although the number format of "Normal" style changes, all the cells are not affected. (It should be, and it is in the Excel application.)
More info
- This might be related with #920 (closed).
- I'm not sure exactly which component is related with this. It might be
workbook
orwriter
or evenstyles
. - I've been using Debian (stretch) package and it's only
2.3.x
. But I tested this with2.5.x
, too, and got same result.