-----Original Message-----
On Thursday, June 21, 2012 6:04 AM Walter Prins wrote
Hope this helps...
When I open a new blank worksheet in Excel 2007 the custom styles
include (from the Home ribbon, Styles) the Number Format styles "Comma,
Comma[0], Currency, Currency[0], Percent". These are missing from the
xlwt 0.7.4 created 'test.xls' you described (although all of the other
custom styles are present).
If I add a 'percent' Custom Styles Number Format that is set to the
"Percentage" format in the Format Cells dialog then using the '%'
quickformat button works without complaint. Note: the case of 'percent'
is different to the 'Percent' Excel complains about being missing - so
case doesn't seem to matter.
Don't know why the other custom styles would be present but all of the
Number Format styles would be missing.
Possibly the Number Format styles are part of the default blank
worksheet that Excel uses when the user asks for a new worksheet.
If I merge the styles from a freshly opened blank worksheet into the
'test.xls' file it grows from 5,632 bytes to 17,408 bytes! (probably
because all the other quickformat button styles are added as well).
This seems like an Excel customization feature that almost everyone
gets by default so looks like a 'standard' but would be wrong to build
into every xlwt created sheet because it is really user optional and
could be wrong for (a possibly very small) set of users.
If you are likely to use the "%" and other quickformat buttons more than
once per worksheet it might be slightly less inconvenient to merge the
custom styles from a blank worksheet. You could even create a macro to
do the merge with one click.
Tim White
This e-mail message may contain client privileged and/or confidential information, and is intended only for the use of the individual or entity named above. Any unauthorized use, dissemination or copying is strictly prohibited. If you have received this communication in error, please notify us immediately by reply e-mail and delete or discard this message.