getting sheet names from openpyxl

Use the sheetnames property: sheetnames Returns the list of the names of worksheets in this workbook. Names are returned in the worksheets order. Type: list of strings print (wb.sheetnames) You can also get worksheet objects from wb.worksheets: ws = wb.worksheets[0]

Get sheet by name using openpyxl

You should use wb[sheetname] from openpyxl import load_workbook wb2 = load_workbook(‘test.xlsx’) ws4 = wb2[“New Title”] PS: You should check if your sheet in sheet names wb.sheetnames print(wb2.sheetnames) [‘Sheet2’, ‘New Title’, ‘Sheet1’]

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)