Worksheet quoting in chart series
Created originally on Bitbucket by act47 (Aaron Thompson)
It would seem a similar issue has been observed in the past, and a simple solution was implemented:
https://bitbucket.org/openpyxl/openpyxl/issues/287/single-quotes-around-work-sheet-names
It would seem however that this does not account for all cases where excel requires a workbook name to be quoted, as I have run across a series of sheet names that also require quoting. I have not determined exactly what the rule is, however I will provide some of the specific sheetnames this applied to. This ultimately caused Series
objects to not appear on scatter charts, resulting in blank charts in the output excel file.
Needs quoting but are passed over by simple check:
#!python
if "-" in sheetname or " " in sheetname:
- bn12.131.02
- bn12.131.14
- bn13.45.07
- bn13.77.03R
Needs quoting, but have a "-" in their sheetname already
- bn12.155.14-1
- bn12.107.01-1
- bn12.131.05-1
From testing does not need quotes
- test.sheet
- Test.sheet.no.1
I am currently using openpyxl 2.4.1 and excel 2016 (windows) but I believe this also should apply to openpyxl 2.5 (adds ','
to check but nothing else)