In this recipe, we'll see how to update an existing Excel spreadsheet. This will include changing raw values in cells but also setting up formulas that will be evaluated when the spreadsheet is open. We'll also see how to add comments to cells.
Updating an Excel spreadsheet
Getting ready
We will use the module openpyxl. We should install the module, adding it to our requirements.txt file as follows:
$ echo "openpyxl==2.5.4" >> requirements.txt
$ pip install -r requirements.txt
In the GitHub repository, there's an Excel spreadsheet named movies.xlsx that contains information on the top ten movies by attendance.
The file can be found here:
https://github.com/PacktPublishing/Python-Automation-Cookbook...