Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to be able to open an xlsx file in Python and select a different dropdown value in a cell which should trigger an update for the entire spreadsheet based on the new value (just how it currently does so if I manually select a different value). How can I do this in Python and which library can help me?

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
201 views
Welcome To Ask or Share your Answers For Others

1 Answer

TL;DR: You can't.

In order to get cascading execution, you need to access the Excel execution engine. Python libraries do not have a copy of this.

If you wish to change additional values in the spreadsheet, you will need to write your Python code to make the changes.

Caveat: There technically is a way to do it using pywin32 if you have a version of Excel installed. In this case Python is simply feeding instructions to Excel, no differently than if you were using VBA. It is significantly more complicated than changing a value using a library such as Openpyxl.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...