Closed horkah closed 8 months ago
I've had same issue – looks like it's because of new version of openpyxl
. Pinning version to openpyxl>=3.0.7,<3.1.0
seems to help. I think formulas
should be updated with recent recommendations from openpyxl
on how to interact with defined names.
Anyone know how difficult it would be to fix this bug? I am also in the same boat on python 3.11.x:
'DefinedNameDict' object has no attribute 'definedName'
I am using openpyxl>=3.1.0 since I need the newly added Custom Data Properties functionality, so I can't downgrade to an older version.
@vinci1it2000, thanks for the awesome work!
I've had same issue – looks like it's because of new version of
openpyxl
. Pinning version toopenpyxl>=3.0.7,<3.1.0
seems to help. I thinkformulas
should be updated with recent recommendations fromopenpyxl
on how to interact with defined names.
What are these recent recommendations, @michaelkryukov?
I'm not sure, but docs should contain needed information (something like that).
I'm facing the same issue and did some digging in the OpenPyXl repository:
In the release note of openpyxl 3.1.0
I found that defined names were restructured: Issue link
(commit of the change)
DefinedNameList
is replaced by DefinedNameDict
when accessing from the worksheet
object.
In openpyxl 3.0.10
:
print(type(workbook.defined_names))
>>> <class 'openpyxl.workbook.defined_name.DefinedNameList'>
In openpyxl 3.1.0
:
print(type(workbook.defined_names))
>>> <class 'openpyxl.workbook.defined_name.DefinedNameDict'>
An other change that might be relevant in the removal of formula_attributes
attribute. (see release notes)
Here the array_formulae
property can be used instead. (commit of the change)
@vinci1it2000 I've never contributed to any open source project, but with some assistance I can try to make a PR to fix these issues.
Looks like it is getting fixed in the next release! Thank you, @vinci1it2000!
Describe the bug The
test_excel.py
script provided here on Git fails to complete without error.To Reproduce I downloaded (6feb2023) the files
test_excel.py
andtest_files
from here: https://github.com/vinci1it2000/formulas/tree/master/testI use python 3.9.16 and installed the missing required packages (
dill
,schedula
,formulas[all]
)I appended the following lines at the end of
test_excel.py
:and receive the following error message:
Expected behavior The
test_excel.py
provided here with the repository is expected to work under Python 3.9 with all required packages installed.Desktop: