I have an existing excel file, with Data on the first and second sheet, I should read both with Python.
Openpyxl reads data from the first/active sheet.
from openpyxl import Workbook, load_workbook
wb = load_workbook('Test.xlsx')
ws = wb.active
It works fine, until I am always on the first sheet.
I tried this:
wb.active = 1 # or
wb.active = 2
Didn't work.
I would like to read sheets not depending on activation, but based on the name of them. (Or Sheet position) I need something like this:
wb = load_workbook('Test.xlsx')
ws1 = wb.Sheet1
ws2 = wb.Sheet2
So, how can I read data from different sheets, without clicking on them?
Or, how can I activate the actually needed sheet?