openpyxl issueshttps://foss.heptapod.net/openpyxl/openpyxl/-/issues2020-06-26T11:57:52Zhttps://foss.heptapod.net/openpyxl/openpyxl/-/issues/1480How to remove the chart title of any chart in excel2020-06-26T11:57:52ZBitbucket ImporterHow to remove the chart title of any chart in excel*Created originally on Bitbucket by [Rupesh Yadav](https://bitbucket.org/%7B593d16cd-bf73-4981-b419-d19a8e034b6d%7D/)*
Currently, I’m trying to create a pie chart in excel but by default it writes a title for the chart, I don’t want any...*Created originally on Bitbucket by [Rupesh Yadav](https://bitbucket.org/%7B593d16cd-bf73-4981-b419-d19a8e034b6d%7D/)*
Currently, I’m trying to create a pie chart in excel but by default it writes a title for the chart, I don’t want any title, I tried to use this
**Chart.title = ''** when I used this it created an empty string but chart title textbox was still there.
And this **chart.title=None**
But nothing worked.
In the desktop application, if we click on the chart it shows a plus button at the side of the chart and when we click it it shows the chart elements such as chart title, data labels, legend and if we untick the chart title, title of the chart will be removed, I want to do this with openpyxl. Can anyone help me with this?
For example I have the chart attached with the problem, I want to remove **Rate\(%\)** from the chart.
*Attachments:* [ezG2P](/uploads/a812694c67ba0c19087d5852ca4d84ee/ezG2P.png)https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1475Alternate theme support for full document2020-06-26T11:57:43ZBitbucket ImporterAlternate theme support for full document*Created originally on Bitbucket by [Erin Piazza](https://bitbucket.org/%7B1f575c44-64d6-48a9-ac9e-ca13020cdd48%7D/)*
I use openpyxl in many scripts to create pre-formatted excel spreadsheets that contain tables. Tablestyleinfo allows y...*Created originally on Bitbucket by [Erin Piazza](https://bitbucket.org/%7B1f575c44-64d6-48a9-ac9e-ca13020cdd48%7D/)*
I use openpyxl in many scripts to create pre-formatted excel spreadsheets that contain tables. Tablestyleinfo allows you to use the name of the style, but the actual appearance of that style depends on the color theme for the document. As far as I can tell, the theme for the document is written as an exact string to a theme.xml document. The theme style used is the old Office style \(Office 2007-2010\), so at a minimum updating to the current default may be useful.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1433Allow user to specify a Worksheet factory2020-06-26T11:56:20ZBitbucket ImporterAllow user to specify a Worksheet factory*Created originally on Bitbucket by [simsong (Simson Garfinkel)](https://bitbucket.org/%7B27d66b94-9121-435c-b888-10de07a5d21b%7D/)*
Currently it is hard-coded [here](https://bitbucket.org/openpyxl/openpyxl/src/8953233f5af287d9cdf3dae34...*Created originally on Bitbucket by [simsong (Simson Garfinkel)](https://bitbucket.org/%7B27d66b94-9121-435c-b888-10de07a5d21b%7D/)*
Currently it is hard-coded [here](https://bitbucket.org/openpyxl/openpyxl/src/8953233f5af287d9cdf3dae34e437e76bea5bd59/openpyxl/workbook/workbook.py#lines-182) that Workbook creates new Worksheets by calling the Worksheet\(\) constructor directly. It would be useful if the constructor was a property so that the user could change it. This would allow the user to have their own Worksheet subclass and for it to be natively used.
I would like this functionality, so I plan to implement this and send it as a pull request. This issue is a placeholder for that.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1412Add ability to enable change tracking2020-06-26T11:55:46ZBitbucket ImporterAdd ability to enable change tracking*Created originally on Bitbucket by [Jacob Floyd](https://bitbucket.org/%7Bcd26d565-2895-420c-8979-c29f7159b8b0%7D/)*
I would like to enable change tracking \(revisions\) in a generated spreadsheet. I do not need to record or work with ...*Created originally on Bitbucket by [Jacob Floyd](https://bitbucket.org/%7Bcd26d565-2895-420c-8979-c29f7159b8b0%7D/)*
I would like to enable change tracking \(revisions\) in a generated spreadsheet. I do not need to record or work with those changes, I just need to initialize the revisions section of a workbook.
Looking in a blank spreadsheet with this enabled I see:
xl/revisions/\_rels/revisionHeaders.xml.rels
xl/revisions/revisionHeaders.xml
xl/revisions/revisionLog1.xml
xl/revisions/userNames.xml
The only files with any content that would need to be adjusted for the workbook \(the others only need the default content\):
xl/revisions/revisionHeaders.xml
* guid attribute on headers element and on child header element
* dateTime and userName attr on child header element.
* sheet counts: maxSheetId on header; count on sheetIdMap element \(child of header\); and sheetId elements \(children of sheetIdMap\).
xl/\_rels/workbook.xml.rels
* Needs references to revisions/userNames.xml and revisions/revisionHeaders.xml
https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1410unescape chars like "_x0020_"2023-10-24T19:29:09ZBitbucket Importerunescape chars like "_x0020_"*Created originally on Bitbucket by [arnaugil126 (Arnau Gil)](https://bitbucket.org/%7B5241fb73-09e5-433f-96fb-2a03d10ec171%7D/)*
I have some xlsx files which contain chars like `_x0020_`, which is the escaped value for `" "` \(empty st...*Created originally on Bitbucket by [arnaugil126 (Arnau Gil)](https://bitbucket.org/%7B5241fb73-09e5-433f-96fb-2a03d10ec171%7D/)*
I have some xlsx files which contain chars like `_x0020_`, which is the escaped value for `" "` \(empty string\) in SharePoint.
xlrd unescape these values to get the original chars using this function [https://github.com/python-excel/xlrd/blob/bbccdcb96e40b590d71ed14682237bea1e8f1dc5/xlrd/xlsx.py#L136](https://github.com/python-excel/xlrd/blob/bbccdcb96e40b590d71ed14682237bea1e8f1dc5/xlrd/xlsx.py#L136)
Could we do the same in openpyxl?
https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1397DataBar axis position when negative values exist2020-06-26T11:55:22ZBitbucket ImporterDataBar axis position when negative values exist*Created originally on Bitbucket by [Justin Lute](https://bitbucket.org/%7B328d02dc-d99e-4901-bb29-b41ac9aaafc9%7D/)*
**USER STORIES**
* As a creator of custom Excel reports using openpyxl, I want to display DataBars where negative v...*Created originally on Bitbucket by [Justin Lute](https://bitbucket.org/%7B328d02dc-d99e-4901-bb29-b41ac9aaafc9%7D/)*
**USER STORIES**
* As a creator of custom Excel reports using openpyxl, I want to display DataBars where negative values are represented by a magnitude \(i.e., bar length\) that increases towards the left of the cell from a central axis, so that negative values are more readily distinguishable from positive values.
* As a creator of custom Excel reports using openpyxl, I want to generate DataBars where negative values have a bar of a different color than positive values, so that negative values are more readily distinguishable from positive values.
**DETAILS**
An extremely valuable feature of conditional formatting in Excel using DataBars is the ability to set the _axis_ position to the center of the cell when there are negative values present in the selection. Moreover, one can even set a different color for negative values. Thus, for example, one could have positive values displayed with a green bar that increases towards the right; with negative values displayed with a red bar that increases towards the left.
For example…
![](https://bitbucket.org/repo/RMdExx/images/3618147029-image.png)
It would appear that there is an API for the axis position \([https://docs.microsoft.com/en-us/office/vba/api/excel.databar.axisposition](https://docs.microsoft.com/en-us/office/vba/api/excel.databar.axisposition)\) and for a negative bar format \([https://docs.microsoft.com/en-us/office/vba/api/excel.databar.negativebarformat](https://docs.microsoft.com/en-us/office/vba/api/excel.databar.negativebarformat)\).
How feasible would it be to implement this in openpyxl? Aside from _openpyxl.formatting.rule.DataBarRule_, where else would changes need to be made?
I am unlikely to be skilled enough to implement this feature myself at this time. Otherwise, I would have implemented already and issued a PR.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1388_HeaderFooterPart not support link to picture with legacyDrawingHF Attributes2020-06-26T11:54:28ZBitbucket Importer_HeaderFooterPart not support link to picture with legacyDrawingHF Attributes*Created originally on Bitbucket by [TWINKLE](https://bitbucket.org/%7B28cea687-7efb-43b5-b8b0-c6ac9b9b896f%7D/)*
\_HeaderFooterPart not support link to picture with legacyDrawingHF Attributes
`ws.oddHeader.left = _HeaderFooterPart(...*Created originally on Bitbucket by [TWINKLE](https://bitbucket.org/%7B28cea687-7efb-43b5-b8b0-c6ac9b9b896f%7D/)*
\_HeaderFooterPart not support link to picture with legacyDrawingHF Attributes
`ws.oddHeader.left = _HeaderFooterPart("&[Picture]")`
```
<headerFooter>
<oddHeader>&L&G&C&T</oddHeader>
<oddFooter></oddFooter>
<evenHeader></evenHeader>
<evenFooter></evenFooter>
<firstHeader></firstHeader>
<firstFooter></firstFooter>
</headerFooter>
```
the right attributes is
# **<legacyDrawingHF r:id="rId3"/>**
```
<headerFooter>
<oddHeader>&L&G&C&T</oddHeader>
</headerFooter>
<legacyDrawingHF r:id="rId3"/>
```
thx.
>
https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1383DrawingML support for Shapes and drawings ?2020-06-26T11:54:13ZBitbucket ImporterDrawingML support for Shapes and drawings ?*Created originally on Bitbucket by [Darak Dir](https://bitbucket.org/%7B67436f4c-1309-41dd-a7e1-7b788aa6365b%7D/)*
My heartfelt gratitude & thanks for openpyxl. Hats Off ! I was able to accomplish and deliver requirements that are not ...*Created originally on Bitbucket by [Darak Dir](https://bitbucket.org/%7B67436f4c-1309-41dd-a7e1-7b788aa6365b%7D/)*
My heartfelt gratitude & thanks for openpyxl. Hats Off ! I was able to accomplish and deliver requirements that are not easily supported \(to my little knowledge\) by Java, .NET & PowerBI. Any possible/tentative dates for shapes & drawing \(if feasible\) ?
https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1523Openpyxl does not read/write worksheet custom properties2022-10-23T09:49:51ZAlex LeyOpenpyxl does not read/write worksheet custom propertiesThese Worksheet.CustomProperties are not to be confused with Workbook.CustomDocumentProperties.
- Worksheet.CustomProperties: https://docs.microsoft.com/en-us/office/vba/api/excel.worksheet.customproperties
- Workbook.CustomDocumentPr...These Worksheet.CustomProperties are not to be confused with Workbook.CustomDocumentProperties.
- Worksheet.CustomProperties: https://docs.microsoft.com/en-us/office/vba/api/excel.worksheet.customproperties
- Workbook.CustomDocumentProperties: https://docs.microsoft.com/en-us/office/vba/api/excel.workbook.customdocumentproperties
They are similar, in that it allows users to save data outside of a sheet/workbook in a collection of objects, each with a name and value.
Workbook.CustomDocumentProperties are saved to the Workbook and have been implemented (pending merge) as part of issue #1003 (and Worksheet.CustomProperties were also discussed and I expressed that I would like to add this feature too)
Worksheet.CustomProperties are slightly more complicated, as there are not only .XML files involved.
Each CustomerProperty is stored as a .bin file, which get's referenced in the "xl/worksheets/sheet{n}.xml" and the "xl/worksheets/_rels/sheet{n}.xml.rels" and the manifest "[Content_Types].xml"Alex LeyAlex Leyhttps://foss.heptapod.net/openpyxl/openpyxl/-/issues/1320support custom data classes in cell value writing2020-06-26T11:52:15ZBitbucket Importersupport custom data classes in cell value writing*Created originally on Bitbucket by [Lars Yunker](https://bitbucket.org/%7Bd12b9e28-de68-4182-b1ad-4cac539659a4%7D/)*
From what I gather, openpyxl only supports python builtin classes when writing to `cell.value`. While this covers the ...*Created originally on Bitbucket by [Lars Yunker](https://bitbucket.org/%7Bd12b9e28-de68-4182-b1ad-4cac539659a4%7D/)*
From what I gather, openpyxl only supports python builtin classes when writing to `cell.value`. While this covers the vast majority of users' needs, it blocks users from writing custom data classes. As an example, I'm trying to provide excel support for a custom class \(a value with a unit\). This can be represented in an excel spreadsheet by setting the cell value to the numerical value and applying a custom format. Instead, I'm greeted with a `ValueError`\(line 238 of `cell._bind_value`\).
I suggest that in the `elif value is not None` block there be an attribute check of the provided value for a `_openpyxl_format` method \(or similarly named\) which will expect a `value` and `number_format` return. If the return fails to produce the expected values then the usual error could be raised. By doing this, you would enable developers to add openpyxl support to their custom classes.
Proposed change to `cell._bind_value`:
```python
elif value is not None:
if hasattr(value, '_openpyxl_format'): # if coded with openpyxl support
# retrieve value and number format
value, number_format = value._openpyxl_format()
# if a number format was specified, apply
if number_format is not None:
self.number_format = number_format
else:
raise ValueError("Cannot convert {0!r} to Excel".format(value))
```
A developer could then add a method like this to their class
```python
def _openpyxl_format(self) -> Tuple[float, str]:
"""adds openpyxl custom formatting support, returning the value and custom number format"""
return self.value, self.custom_format
```
For example "10.123 mL" would give the return `(10.123, '0.0" mL"')`. This correctly sets the value in the cell and applies a valid custom format to the number in Excel. Applying this change appears to work in my brief testing and should not affect other users \(unless the method is specifically coded, nothing different will happen\). The developer will have to ensure that the custom format is valid, but I see that as a reasonable caveat. Improper specification of this format results in an workbook recovery prompt, but this is identical to the user manually specifying an invalid number format.
I appreciate that I could accomplish the same thing with this code:
```python
cell.value = float(passed_value)
cell.number_format = '0.0" mL"'
```
but I feel that it is unnecessary to expect users who want to use a custom class and openpyxl together to manually code value writing where the addition of a class method will define the writing behaviour of all instances of that class.
I’m happy to break this out into a branch and create a merge request, but I wanted to open it for discussion before doing that.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1300Styles are not transfered when inserting a row2024-02-23T22:51:05ZBitbucket ImporterStyles are not transfered when inserting a row*Created originally on Bitbucket by [Vincent PFARR (Vincent Pfarr)](https://bitbucket.org/%7B12e6c61e-538f-4282-a934-099b4875e0b7%7D/)*
Using a template with styles \(row height modified, cell colors, cell merged, etc.\) i would like to...*Created originally on Bitbucket by [Vincent PFARR (Vincent Pfarr)](https://bitbucket.org/%7B12e6c61e-538f-4282-a934-099b4875e0b7%7D/)*
Using a template with styles \(row height modified, cell colors, cell merged, etc.\) i would like to insert a row somewhere here.
When inserting a row, text after this row is moving one row after what is correct, but the style stays at the same row.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1202Accessing/Modifying Existing Charts2020-06-26T11:48:05ZBitbucket ImporterAccessing/Modifying Existing Charts*Created originally on Bitbucket by [thephatp (Chad Morris)](https://bitbucket.org/%7Ba1ebd120-0170-40bd-93c1-beb2ef76e57a%7D/)*
Is there any way to access an existing chart, rather than having to create a new chart each time?
My use...*Created originally on Bitbucket by [thephatp (Chad Morris)](https://bitbucket.org/%7Ba1ebd120-0170-40bd-93c1-beb2ef76e57a%7D/)*
Is there any way to access an existing chart, rather than having to create a new chart each time?
My use case is this: I'm pulling data from an external source and putting into excel. I have an existing chart that visualizes the data. I want to grab the chart as it exists already and save the chart as an image.
My problem: I don't see a way via the documentation for openpyxl to get an existing Chart object--only creating new.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1121add_image does not respect DPI-setting of images2020-06-26T11:45:17ZBitbucket Importeradd_image does not respect DPI-setting of images*Created originally on Bitbucket by [xorx1 (G. Wiora)](https://bitbucket.org/%7B8150fa9c-a8e6-46d5-b4db-af8582e3cf5b%7D/)*
When adding an image to an excel sheet it is always displayed with the default resolution. Width and height prope...*Created originally on Bitbucket by [xorx1 (G. Wiora)](https://bitbucket.org/%7B8150fa9c-a8e6-46d5-b4db-af8582e3cf5b%7D/)*
When adding an image to an excel sheet it is always displayed with the default resolution. Width and height properties are set to the number of pixels respectively. That means it is not displayed with its print size but with its pixel size.
It would be better if the DPI setting in the image file would be used to adapt the display size of the image accordingly. The following formulas should solve the problem:
```
#!python
wb.active._images[0].width = xpixel * defaultXDPI / imageXDPI
wb.active._images[0].height = ypixel * defaultYDPI / imageYDPI
```https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1113Being able to copy charts and update them with new data2020-06-26T11:44:59ZBitbucket ImporterBeing able to copy charts and update them with new data*Created originally on Bitbucket by [stefun06 (Stéphane Rapuc)](https://bitbucket.org/%7Bca355879-0ce7-4230-b60f-5c5fdfa88dfa%7D/)*
Hello,
I am really missing the option to be able to copy chart with new data. Example case:
1) creat...*Created originally on Bitbucket by [stefun06 (Stéphane Rapuc)](https://bitbucket.org/%7Bca355879-0ce7-4230-b60f-5c5fdfa88dfa%7D/)*
Hello,
I am really missing the option to be able to copy chart with new data. Example case:
1) create a chart template in excel based on example data.
2) through python add to the excel different data set and copy the chart to get one chart per set of data.
In my view, this could be done using copy_worksheet, if it would also copy the charts...https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1087Inefficiency in MultiCellRange2020-06-26T11:44:13ZBitbucket ImporterInefficiency in MultiCellRange*Created originally on Bitbucket by [fjiahai (Jiahai Feng)](https://bitbucket.org/%7Bcc5d29a1-a2a5-477b-8453-047f345829a2%7D/)*
I was working with a large excel file with many rows of merged cells when I noticed that the performance was...*Created originally on Bitbucket by [fjiahai (Jiahai Feng)](https://bitbucket.org/%7Bcc5d29a1-a2a5-477b-8453-047f345829a2%7D/)*
I was working with a large excel file with many rows of merged cells when I noticed that the performance was really bad. After using a profiler, I identified a possible issue with the implementation of MultiCellRange.__contains__ in worksheet.cell_range.py
Each query of __contains__ is O(n) in number of ranges, which is really slow. I propose that a more efficient data structure be used, like a quad tree or a simpler set-based solution.
I would love to contribute code but I'm new to open source so I don't know how the process works. Let me know if I can help.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1064Allow input of pathlib2 paths instead of file names2020-06-26T11:43:25ZBitbucket ImporterAllow input of pathlib2 paths instead of file names*Created originally on Bitbucket by [gappleto97](https://bitbucket.org/%7B5c8d0a4b-7763-424c-a8b9-6a954a7f907e%7D/)*
pathlib2 is a backported version of pathlib, so that people can use the latest version instead of the one that comes wi...*Created originally on Bitbucket by [gappleto97](https://bitbucket.org/%7B5c8d0a4b-7763-424c-a8b9-6a954a7f907e%7D/)*
pathlib2 is a backported version of pathlib, so that people can use the latest version instead of the one that comes with Python (if it comes with it at all).
At the moment, when you feed it a path from pathlib, both load_workbook and workbook.save throw errors.
For load_workbook, it is because it calls os.stat, and for workbook.save, it is because it tries to call the tell() method of the path, which does not exist.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1008Texture Fill in Plot Lost When Open / Save WB with openpyxl2021-10-13T08:27:49ZBitbucket ImporterTexture Fill in Plot Lost When Open / Save WB with openpyxl*Created originally on Bitbucket by [dgalt11 (D)](https://bitbucket.org/%7B36a60484-6cf4-4c0c-94a1-089b3ef14628%7D/)*
I'm working with some Excel files that contain plots that use pictures (or textured fills) for the line plot marker.
...*Created originally on Bitbucket by [dgalt11 (D)](https://bitbucket.org/%7B36a60484-6cf4-4c0c-94a1-089b3ef14628%7D/)*
I'm working with some Excel files that contain plots that use pictures (or textured fills) for the line plot marker.
However, opening the file with openpyxl and then re-saving it causes that texture to be lost.
For example, the attached file just has a very simple line plot where I set the markers to be a texture.
Just doing:
```
#!python
wb = openpyxl.load_workbook('./test_plot.xlsx')
wb.save('./test_plot_copy.xlsx')
```
Will result in the texture being replaced by the automatic fill.
*Attachments:* [test_plot.xlsx](/uploads/deeb283628aaff91b2bed2af7b767868/test_plot.xlsx)https://foss.heptapod.net/openpyxl/openpyxl/-/issues/975Support for xlsx encyption2021-07-29T08:45:17ZBitbucket ImporterSupport for xlsx encyption*Created originally on Bitbucket by [SZim92 (Steven Zimmerman)](https://bitbucket.org/%7B0d32c50b-4882-441e-a517-5e1e878290c8%7D/)*
Hi, I know this is not a high priority project, but the xlsx file format has support built in for encryp...*Created originally on Bitbucket by [SZim92 (Steven Zimmerman)](https://bitbucket.org/%7B0d32c50b-4882-441e-a517-5e1e878290c8%7D/)*
Hi, I know this is not a high priority project, but the xlsx file format has support built in for encrypting documents as part of the workbook protection feature, which it is my understanding that openpyxl does not currently support.
I feel that this would be a useful feature to support, and wanted to put it on your radar by creating an enhancement request for it.
It is my understanding that LibreOffice Calc contains support for this feature, as does Microsoft Excel.
If there's anything I can do to help get this feature working, please let me know.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/914Hide multiple columns at once using ColumnDimension2020-06-26T11:37:57ZBitbucket ImporterHide multiple columns at once using ColumnDimension*Created originally on Bitbucket by [sverkersbrg (Sverker Sjöberg)](https://bitbucket.org/%7Bc0379d0c-6269-46c2-adfa-f179777a7d24%7D/)*
I'm working on a project where I'm creating sheets containing a single DataTable and I am hiding all...*Created originally on Bitbucket by [sverkersbrg (Sverker Sjöberg)](https://bitbucket.org/%7Bc0379d0c-6269-46c2-adfa-f179777a7d24%7D/)*
I'm working on a project where I'm creating sheets containing a single DataTable and I am hiding all excessive (unused) columns. I do this by looping over each column and hiding them one by one. Unfortunately this produces one xml entry per column like
```
#!xml
<col min="7" max="7" hidden="1"/>
<col min="8" max="8" hidden="1"/>
<col min="9" max="9" hidden="1"/>
```
Is there any reason not to use a ColumnDimension to hide all columns and create an xml entry like this.
```
#!xml
<col width="0" max="16384" min="7" hidden="1"/>
```
This could be implemented by adding the method "hide" to the DimensionHolder
```
#!python
def hide(self, start, end):
if end is None:
end = start
new_dim = self[start]
new_dim.hidden = True
work_sequence = get_column_interval(start, end)[1:]
for column_letter in work_sequence:
if column_letter in self:
del self[column_letter]
new_dim.min, new_dim.max = map(column_index_from_string, (start, end))
```
It seems to work fine in my environment.
Awesome package,
Sverkerhttps://foss.heptapod.net/openpyxl/openpyxl/-/issues/893Data table feature not supported in charts2020-06-26T11:37:10ZBitbucket ImporterData table feature not supported in charts*Created originally on Bitbucket by [yukibo (yukibo Bobo Bo Bobo)](https://bitbucket.org/%7B00657a68-a57c-4ef4-a4b4-fbab0ef00d8a%7D/)*
When writing to a worksheet that contains charts with data tables, those data tables dissapear becaus...*Created originally on Bitbucket by [yukibo (yukibo Bobo Bo Bobo)](https://bitbucket.org/%7B00657a68-a57c-4ef4-a4b4-fbab0ef00d8a%7D/)*
When writing to a worksheet that contains charts with data tables, those data tables dissapear because the use of data tables seems not to be supported by openpyxl at the moment.
Using openpyxl 2.5.0a3 , can be reproduced by opening a simple worksheet with one graph containing a data table, then writing to the file.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/891Could Conditional Formatting DataBar add gradient fill & solid fill options2023-04-24T08:42:48ZBitbucket ImporterCould Conditional Formatting DataBar add gradient fill & solid fill options*Created originally on Bitbucket by [JianJhih-Liao (Ken Tsd)](https://bitbucket.org/%7Bd1878366-e602-4f89-91a0-591b9aa29273%7D/)*
```
#!python
first = FormatObject(type='min')
second = FormatObject(type='max')
data_bar =...*Created originally on Bitbucket by [JianJhih-Liao (Ken Tsd)](https://bitbucket.org/%7Bd1878366-e602-4f89-91a0-591b9aa29273%7D/)*
```
#!python
first = FormatObject(type='min')
second = FormatObject(type='max')
data_bar = DataBar(cfvo=[first, second], showValue=True, color='FF638EC6')
rule = Rule(type='dataBar', dataBar=data_bar)
```
DataBar is default gradient fill, could add solid fill options ?
poor english : )https://foss.heptapod.net/openpyxl/openpyxl/-/issues/843Reading Excel's Table ref cells (in read only mode)2020-06-26T11:35:14ZBitbucket ImporterReading Excel's Table ref cells (in read only mode)*Created originally on Bitbucket by [asommerh](https://bitbucket.org/%7B1b88f6c2-0057-49f7-8022-82b331ff7538%7D/)*
When I open an existing excel file in read only mode (for speed reasons), the information of the table excel objects are ...*Created originally on Bitbucket by [asommerh](https://bitbucket.org/%7B1b88f6c2-0057-49f7-8022-82b331ff7538%7D/)*
When I open an existing excel file in read only mode (for speed reasons), the information of the table excel objects are not loaded (it works fine in read+write mode). Specifically, it would be nice to have the following properties working in readonly (fast!) mode:
```
#!python
wb['sheetOne']._tables[t].name
wb['sheetOne']._tables[t].ref
wb['sheetOne']._tables[t].tableColumns[c].name
wb['sheetOne']._tables[t].tableColumns[c].id
```
Maybe it can be implemented with a new ReadOnlyTable class (lighter than Table class), as there is a ReadOnlyWorksheet?
*PS: What I'm trying to do is to read some tables by name (defined_names is not what I'm looking for, because they don't behave good for users adding more rows and tables have much more better formulas expressions) and later load the table data in some python objects.*https://foss.heptapod.net/openpyxl/openpyxl/-/issues/737Add image to header footer2023-12-21T10:31:13ZBitbucket ImporterAdd image to header footer*Created originally on Bitbucket by [notomoro (William R Marchand)](https://bitbucket.org/%7B8df01c47-7ef4-47da-b809-79593b375a6f%7D/)*
Hello and thanks for the wonderful openpyxl.
I need to add an image to the header and the footer.
...*Created originally on Bitbucket by [notomoro (William R Marchand)](https://bitbucket.org/%7B8df01c47-7ef4-47da-b809-79593b375a6f%7D/)*
Hello and thanks for the wonderful openpyxl.
I need to add an image to the header and the footer.
I don't believe this is possible.
Any clue on how I could add such a feature? Any plans?
Thanks again.
*Attachments:* [Untitled](/uploads/614a9967d58808f479453baf82620806/Untitled.png)Steven HansenSteven Hansenhttps://foss.heptapod.net/openpyxl/openpyxl/-/issues/628Translator has limited opportunities for extension2020-06-26T11:28:09ZBitbucket ImporterTranslator has limited opportunities for extension*Created originally on Bitbucket by [Nigglefish (Nigel Fisher)](https://bitbucket.org/%7Baa82836f-1d84-4663-845b-20171db39d0c%7D/)*
Translator has several static and class methods that make it difficult to extend.
My use case is that...*Created originally on Bitbucket by [Nigglefish (Nigel Fisher)](https://bitbucket.org/%7Baa82836f-1d84-4663-845b-20171db39d0c%7D/)*
Translator has several static and class methods that make it difficult to extend.
My use case is that I am attempting to implement the type of formula translation that occurs when you delete or insert a row in Excel (LibreOffice, actually). The formula should be translated as usual unless it refers to a cell before the deleted columns/rows, in which case it is left unchanged.
I would like to simply override translate_col and translate_row to use instance attributes that characterise this behaviour but the static and class methods here make that impractical.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/414Unable to style range of cells2020-06-26T11:20:39ZBitbucket ImporterUnable to style range of cells*Created originally on Bitbucket by [Josh Haywood](https://bitbucket.org/%7Bfe598029-15ca-411a-9bf3-3103e2875471%7D/)*
Styling a range of cells doesn't seem to be supported. The following code returns an AttributeError: 'generator' obje...*Created originally on Bitbucket by [Josh Haywood](https://bitbucket.org/%7Bfe598029-15ca-411a-9bf3-3103e2875471%7D/)*
Styling a range of cells doesn't seem to be supported. The following code returns an AttributeError: 'generator' object has no attribute 'style'.
```
#!python
import tkinter as tk
from tkinter import filedialog
import csv, random
from openpyxl import Workbook
from openpyxl import load_workbook
from openpyxl.styles import Style, PatternFill, Border, Side, Alignment, Protection, Font, Color
###Some Code Here###
def onRandoClick(self):
count = 0
data = []
header = ["Animal #", "Weight (g)"]
while count < self.totalAnimals.get():
data.append(self.startAnimalNum.get() + count)
count += 1
random.shuffle(data)
wb = Workbook()
ws = wb.active
ws.cell('A1').value = header[0]
ws.cell('B1').value = header[1]
j = 0
for i in range(2, self.totalAnimals.get() + 1):
ws.cell(row = i, column = 1).value = data[j]
j = j + 1
endRow = str(self.totalAnimals.get() + 1)
sel = ws['A2':'B%s' % endRow]
sel.style = Style(font=Font(color=Color('ff0000')))
wb.save(self.randoFilepath + '//%s Randomization.xlsx' % self.studyNumber.get())
root.destroy()
###Some Code Here###
```https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1671Validate user entered formulae using the tokeniser2021-04-16T09:46:06ZCharlieCValidate user entered formulae using the tokeniserWe can probably use the tokeniser to sanity check formulae entered by users. This should pick up unknown function names and common formatting mistakes such as using ";" instead of "," to separate parameters.We can probably use the tokeniser to sanity check formulae entered by users. This should pick up unknown function names and common formatting mistakes such as using ";" instead of "," to separate parameters.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1970Allow chartsheets to contain multiple charts2023-02-17T16:48:36ZCharlieCAllow chartsheets to contain multiple chartsChartsheets can contain more than one chart. This is done in Excel by creating the charts and moving them to the chart sheets. Openpyxl can neither read nor create such chartsheets.
The implementation is interesting because it uses rela...Chartsheets can contain more than one chart. This is done in Excel by creating the charts and moving them to the chart sheets. Openpyxl can neither read nor create such chartsheets.
The implementation is interesting because it uses relative sizing. But it also relies on shoehorning the visible charts into the userShapes part of an essentially empty chart. Implementation might allow a simpler API for chartsheets: limit them to one chart only but introduce the idea of a multichart. NB. this is semantically very different to combi charts which share the same plot area.
[multi.xlsx](/uploads/fc1396101b14f6a7e73dbba5beef9fad/multi.xlsx)https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1981Setting active sheet does not unset active attribute of previous one2023-02-27T10:06:32ZgsportelliSetting active sheet does not unset active attribute of previous oneWhen I set the active sheet like this:
wb.active = 3
and then save and open the workboox with Excel, sheet 3 is active as intended, but the old active sheet remains active as well.
Other users have seen this behaviour as [posted h...When I set the active sheet like this:
wb.active = 3
and then save and open the workboox with Excel, sheet 3 is active as intended, but the old active sheet remains active as well.
Other users have seen this behaviour as [posted here](https://groups.google.com/g/openpyxl-users/c/Y9_iSeTi3bM).https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1990Create conversion utilities for Excel tables and PivotTables to Pandas Datafr...2023-03-11T16:42:03ZCharlieCCreate conversion utilities for Excel tables and PivotTables to Pandas DataframesThe XML types probably contain sufficient information and metadata to allow creation of Dataframes programmatically.
Probably easiest to start with Tables because they're much simpler.The XML types probably contain sufficient information and metadata to allow creation of Dataframes programmatically.
Probably easiest to start with Tables because they're much simpler.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1994Separate outlining from formatting for column (and possiby row dimensions)2023-03-16T14:19:50ZCharlieCSeparate outlining from formatting for column (and possiby row dimensions)As per #1988 the implementation of column dimensions is probably too close the OOXML which is at best vague and at worst downright misleading.
The major problem with the specification is that it conflates column specific attributes such...As per #1988 the implementation of column dimensions is probably too close the OOXML which is at best vague and at worst downright misleading.
The major problem with the specification is that it conflates column specific attributes such as width, with cell formats even though these are not applied and outlining definitions for groups of columns. This is less of a problem for rows, not least because grouping is implied solely through the outline level.
The proposal is to create a separate worksheet level object solely for grouping columns for outlining purposes. This would make the API more explicit: `ws.column_groups` would only contain ranges with the relevant outlining settings; `ws.column_dimensions` would only contain information for individual columns with groups not possible.
When reading existing worksheets groups would be checked for their attributes. Outlines would be added to column_groups, formatting would be split into individual columns.
The definition can be preserved at serialisation time because the format allows multiple definitions with precedence being given to the last definition.
It is to be decided as to whether an orthogonal property should exist for row groups because these do not implement grouping directly.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/2006Add `width` and `height` properties to `CellRange` objects2023-04-06T15:37:09ZCharlieCAdd `width` and `height` properties to `CellRange` objectsIt can be useful to know how wide or tall a range of cells is for calculating stuff.It can be useful to know how wide or tall a range of cells is for calculating stuff.CharlieCCharlieChttps://foss.heptapod.net/openpyxl/openpyxl/-/issues/2041Can't do a branch in this repo and ide doesn't work2023-05-17T09:53:54Zpablo ruizCan't do a branch in this repo and ide doesn't workNot a real issue of the code, I'm new in gitlab-heptapod and mercurial and just want to make a contribution but it's being very hard for me, I don't understand why a "hook" is preventing me to branch the code:
![image](/uploads/85454e18...Not a real issue of the code, I'm new in gitlab-heptapod and mercurial and just want to make a contribution but it's being very hard for me, I don't understand why a "hook" is preventing me to branch the code:
![image](/uploads/85454e1812ae6fe4e190592f360a8554/image.png)
Also in the online editor:
![image](/uploads/7960b9b10a10d9faf16a361370182e0f/image.png)
These messages should be a bit more self explanatory, probably they come from the gitlab side, but I didn't find the way of contributing here whatsoever. I also took a look into the docs:
https://openpyxl.readthedocs.io/en/stable/development.html
But i find no information on how to make a branch or a pull request without getting these errors. I have experience using github, but still found a significant barrier for contributing here. At first I didn't even know that we need first to request access etc. In any case I think it would be helpful to expand into the contributions docs, to cover these questions in the readme, or in general make the entry barrier a bit lower. I can help to document the contribution process if you want.
I don't know where to ask better than making this issue, maybe in the mail list was a better idea? please feel free to move the issue to a more appropriate place or close it.https://foss.heptapod.net/openpyxl/openpyxl/-/issues/2113Add repr for dimensions2023-11-16T12:02:06ZCharlieCAdd repr for dimensionsWould be nice to be able to see column and row dimensions directly without additional introspection.Would be nice to be able to see column and row dimensions directly without additional introspection.CharlieCCharlieC