Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Load Workbook | Openpyxl
Excel Automation with Python (project)

book
Load Workbook

load_workbook() is a method provided by the openpyxl library in Python that allows you to load an existing Excel workbook from a file into memory. The load_workbook() method takes a filename as a parameter and returns a workbook object that represents the file's contents.

Taak

Swipe to start coding

  1. Load a workbook called "sample_data.xlsx";
  2. Print the sheetnames;
  3. Print the active sheet.

Oplossing

from openpyxl import load_workbook

workbook = load_workbook(filename="sample_data.xlsx")

print(workbook.sheetnames)
print(workbook.active)

Mark tasks as Completed
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 4

Vraag AI

expand
ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

some-alt