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

We Specialize in teaching and tutoring Python from intro to advanced modules like Pandas and Machine learning to Non Programming and 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

Python Programming online tutors


Python Programming for Beginners

Python for Advanced Level

for University Python Programming Course

for Practical tasks at work

Python Projects Help & Guidance

Automating your computing tasks


Learn Python, Advance in your Career Join Now

For More information

Python Trainings Online


Python for Non Programmers Training

Machine Learning for Beginners Training

Deep Learning for Beginners Training

Python Pandas Training Tutors

Numpy, Matplotlib, Scipy Tutors

Keras, Tensorflow, Theano Tutors


Flexible and Tailored for your Specific Needs

More info on Trainings

Python Online Training Features


Live (1 on 1) Python Tutoring at Skype

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           © 2020 All rights reserved by www.PythonTutor.net