I'm new to the Stackoverflow community and I'm currently trying to figure out how to load a workbook into openpyxl using IDLE 3.9.1.
I'm trying to follow a tutorial that I purchased from Streamskill which was actually pretty good until I ran into this problem and have spent multiple hours trying to figure out where I went wrong.
Thought it had something to do with a file location but it is saved in my Python39 folder. the xlsx file in question is just a blank template from Google Sheets titled "Monthly Budget" I've attached a picture of it if that helps.
Thanks and hope to hear from you soon,
Ben Monthly Budget
>>> import openpyxl
>>> import os
>>> os.getcwd()
'C:\\Users\\Ben\\AppData\\Local\\Programs\\Python\\Python39'
>>> from openpyxl import load_workbook
>>> workbook = load_workbook(filename='budget.xlsx')
Traceback (most recent call last):
File "<pyshell#11>", line 1, in <module>
workbook = load_workbook(filename='budget.xlsx')
File "C:\Users\Ben\AppData\Local\Programs\Python\Python39\lib\site-packages\openpyxl\reader\excel.py", line 317, in load_workbook
reader.read()
File "C:\Users\Ben\AppData\Local\Programs\Python\Python39\lib\site-packages\openpyxl\reader\excel.py", line 282, in read
self.read_worksheets()
File "C:\Users\Ben\AppData\Local\Programs\Python\Python39\lib\site-packages\openpyxl\reader\excel.py", line 228, in read_worksheets
ws_parser.bind_all()
File "C:\Users\Ben\AppData\Local\Programs\Python\Python39\lib\site-packages\openpyxl\worksheet\_reader.py", line 443, in bind_all
self.bind_merged_cells()
File "C:\Users\Ben\AppData\Local\Programs\Python\Python39\lib\site-packages\openpyxl\worksheet\_reader.py", line 380, in bind_merged_cells
self.ws._clean_merge_range(mcr)
File "C:\Users\Ben\AppData\Local\Programs\Python\Python39\lib\site-packages\openpyxl\worksheet\worksheet.py", line 607, in _clean_merge_range
mcr.format()
File "C:\Users\Ben\AppData\Local\Programs\Python\Python39\lib\site-packages\openpyxl\worksheet\merge.py", line 109, in format
if side.style is None:
AttributeError: 'NoneType' object has no attribute 'style'