Tutorial — openpyxl 3.0.9 documentation
openpyxl.readthedocs.io › en › stableThe same way as writing, you can use the openpyxl.load_workbook () to open an existing workbook: >>> from openpyxl import load_workbook >>> wb2 = load_workbook('test.xlsx') >>> print(wb2.sheetnames) ['Sheet2', 'New Title', 'Sheet1'] This ends the tutorial for now, you can proceed to the Simple usage section
openpyxl - A Python library to read/write Excel 2010 xlsx ...
openpyxl.readthedocs.iofrom openpyxl import Workbook wb = Workbook() # grab the active worksheet ws = wb.active # Data can be assigned directly to cells ws['A1'] = 42 # Rows can also be appended ws.append( [1, 2, 3]) # Python types will automatically be converted import datetime ws['A2'] = datetime.datetime.now() # Save the file wb.save("sample.xlsx") Documentation ¶