Horizontal alignement du texte dans openpyxl

Je suis tryign pour modifier l'alignement du texte au centre de 2 fusionné vend, j'ai trouvé des réponses qui n'a pas fonctionné pour mon cas

currentCell = ws.cell('A1')
currentCell.style.alignment.horizontal = 'center' #TypeError: cannot set horizontal attribute
#or
currentCell.style.alignment.vertical = Alignment.HORIZONTAL_CENTER #AttributeError: type object 'Alignment' has no attribute 'HORIZONTAL_CENTER'

les deux ne fonctionne pas, est-il d'autres façons de le faire?

InformationsquelleAutor Pythonizer | 2014-10-31