Automation with PyWin32

Automate Excel Chart with Python

Automate the chart in Excel and export it as an image. Save your time for… watching this kitty?

KahEm Chu
6 min readJun 28, 2021

--

Photo by Kate Stone Matheson on Unsplash

Since I started working as a data analyst (a novice one), some of my tasks are stick with the same cycle. I am repeating the same process over and over again with different data. So, I can’t stop thinking how wonderful it will be if I can automate all these processes. So, here I am with another automation article.

Process Cycle. Image by Author.

The image above summarizes my repetitive tasks, where I will need to process the new data and update them into the Excel report, then update the chart in the PowerPoint for the presentation used. I can automate Excel with Python and create the interactive Excel Pivot Table with Python with PyWin32 library (not hardcoded Pivot Table from pandas.pivot_table). Now, I will be showing how I create the charts in Excel with Python.

Let’s get started!

Create Excel Object

To work with Excel, the first step is always to create Excel Object and open the specific Excel Workbook.

--

--

KahEm Chu
KahEm Chu

Written by KahEm Chu

Date Science and Analytics Graduate. Passionate in data science, decision science and automating stuff =]