'Worksheet.columns' is a generator, you cannot subscript it (i.e. use square bracket notation to access elements)
you can iterate over it, or convert it to list/tuple and then use subscript.
https://openpyxl.readthedocs.io/en/stabl...many-cells
https://openpyxl.readthedocs.io/en/stabl...et.columns
Again it is change in API in 2016
https://openpyxl.readthedocs.io/en/stabl...2016-04-11
ws.rows and ws.columns now always return generators and start at the top of the worksheet
Maybe you should find more recent book or carefully check changelog for discrepancies
you can iterate over it, or convert it to list/tuple and then use subscript.
https://openpyxl.readthedocs.io/en/stabl...many-cells
https://openpyxl.readthedocs.io/en/stabl...et.columns
Again it is change in API in 2016
https://openpyxl.readthedocs.io/en/stabl...2016-04-11
ws.rows and ws.columns now always return generators and start at the top of the worksheet
Maybe you should find more recent book or carefully check changelog for discrepancies
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs