-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openpyxl: no attribute "column_dimensions" #11706
Comments
Cc @Avasam |
The issue here is raised by not knowing statically whether your workbook is read_only, write_only, or "regular", and whether it contains Related to #9940 , where a generic workbook would help with knowing whether worksheets, and cells, are write_only or read_only, but that still wouldn't help with With the last stub update, you can do: import openpyxl
from openpyxl.worksheet.worksheet import Worksheet
workbook = openpyxl.open(filename)
sheet = workbook [worksheet_name]
assert isinstance(sheet, Worksheet) # sheet is a Worksheet
sheet.column_dimensions or import openpyxl
from openpyxl.worksheet.worksheet import Worksheet
workbook = openpyxl.open(filename)
sheet = workbook[worksheet_name]
if isinstance(sheet, Worksheet): # sheet is a Worksheet
sheet.column_dimensions This is yet another case for python/typing#566 That being said, with #9940 being an open issue with a potential better long-term solution (with the fudging of |
Thanks @Avasam, I'll use one of the workarounds for now |
Got this error after today's release:
Code example:
The text was updated successfully, but these errors were encountered: