Python Tutoring Online
 Home            

Openpyxl load_workbook()

In this article you will learn how to load or open a workbook in Python using openpyxl load_workbook() function. This method is used when you have to read or write to an existing excel file in Python. 

Syntax of load_workbook()

The syntax of load workbook function is 

ref_to_workbook = openpyxl.load_workbook(file name)

This syntax will work if your existing excel file is in your current working directory. In case if you want to access a spreadsheet from anywhere on your computer you will provide a path to your file with full file name and extension. 

ref_to_workbook = openpyxl.load_workbook(path)

where path can be like 

"c:/myfiles/testfile.xlsx"

Example: load_workbook()

First example is when a file named uberdata.xlsx is in your current working directory and you want to open it or load it in python using openpyxl.

import openpyxl

mywb = openpyxl.load_workbook("uberdata.xlsx")

If excel file is not in your working directory, write full path of file with name and extension.

mywb = openpyxl.load_workbook("D:/datafiles/uberdata.xlsx")

Non Computer Science Background Students

In addition to Computer Science learners we also specialize in teaching and tutoring Python from intro to advanced modules like Pandas and Machine learning to Non computer science Python learners.

If you are not from CS We will train you that there will be no difference between your Python skills and CS programmers Python skills.

Join Now

Get Online Tutors for


Python Programming for Beginners

& Advanced Level

for University Python Programming Course

for Practical tasks at work

Python Projects Help & Guidance

Automating your computing tasks


Join now to Advance in your Career

For More information

Python Trainings Online


Python for Non Programmers Training

Machine Learning for Beginners Training

Deep Learning for Beginners Training

Pandas Data Analysis Tutoring

Numpy, Matplotlib, Scipy Tutoring

Keras, Tensorflow, Theano Tutoring


Flexible and Tailored for your Specific Needs

More info on Trainings

Salient Features


Live (1 on 1) Python Tutoring at Skype/Zoom

Learn Practical Examples

Work on Python Projects

High Quality Training from Experts

You may select your Syllabus for Tutoring

Flexible Timings: Select time which suits you


Guaranteed Learning

Join Course

PythonTutor.net

Home    Tutorial     Online Live Trainings    Contact Us           © 2023 All rights reserved by www.PythonTutor.net