defined_names is not working even if i am having defined cell range in my excel worksheet
Created originally on Bitbucket by Balkar Singh
Hi, i tried running the following code and i’m facing an error everytime i run it. I’m using jupyter notebook to run it. My current excel file named ‘Saved_Pivots’ is of xlsx type created on WPS.
import openpyxl
from openpyxl import load_workbook
from openpyxl import *
from openpyxl.styles import NamedStyle
workbook = load_workbook('Saved_Pivots.xlsx')
worksheet = workbook.active
w=worksheet.defined_names.[’efd']
w
When i run it i’m facing the following error:-
AttributeError Traceback (most recent call last)
<ipython-input-133-384592a4b081> in <module>
10 worksheet = workbook.active
11 #worksheet.title = 'abc'
---> 12 w=worksheet.defined_names.definedName
13 w
AttributeError: 'Worksheet' object has no attribute 'defined_names'
Attachments: Saved_Pivots.xlsx