Automate Excel Spreadsheet with Python

preview_player
Показать описание
In this Python tutorial, I will be covering how to automate Excel spreadsheets using win32com (pywin32) library in Python.

Things I will be covering in this tutorial:
1. Create a new Excel spreadsheet
2. Write/Read data from an Excel spreadsheet
3. Save the Excel file

Buy Me a Coffee? Your support is much appreciated!
----------------------------------------------------------------------------------------------------------------
Venmo: @Jie-Jenn

To install win32com library: pip install pywin32

# why win32com?
As a Windows user myself, the win32com library provides me with the flexibility to communicate multiple applications and integrate them with ease. Especially, I can control the applications while the applications are open. The other advantage win32com has over other Excel Python libraries is that, using win32com to link to an COM object application, I will have access to the entire object models vs other Excel Python libraries will only have a limited features available.

## win32com (pywin32)
A Python extension for Microsoft Windows provides access to the Win32 API. Using Win32 API, we will be able to create and use COM objects to automate applications such as Microsoft Excel, Outlook, Word, Access, PowerPoint, or event Photoshop. On top that, we will be able to automate a wide range of features on Windows.

Support my channel so I can continue making free contents
---------------------------------------------------------------------------------------------------------------

Tags:
#Excel #Python #win32com
Рекомендации по теме
Комментарии
Автор

thanks Jie, this simple to understand that it is possible modify data in excel with Pyton, no need VBA

surat-dtsr
Автор

Thank you for preparing the awesome video. This video is very easy to understand. I have the motivation to continue learning python.

pacerthanyalak
Автор

Thank you thank you. Now I know how to use VBA Object modele in my Python code. I search this many years. I didnt think just to take from Microsoft doc. So simple.

pimalanda
Автор

Hi Jie, Can you tell if pywin32 can help with the below use case?

1.I want to import Excel and read as Dataframe
2.Then do some Spacy based text analysis. I will also use other packages.
3.Finally store the results (scores) in New columns
4.Export the Excel

krishna
Автор

You should add chapters to your video. Makes it more useful. Thanks

vectortonto
Автор

Nice,
What is the difference with xlWings? which is better? Tranks!!!

rayo
Автор

Awesome video, keep up the amazing work! :)

ComputerScienceSimplified
Автор

Thanks for this video! Could you advise which would be the best way to copy data between different books? My main goal would be to create a database by getting data from various excel books in just one. Thanks in advance!

marvynrodriguez
Автор

Great video! How do I dynamically copy the range from A1 to E5 without specifying E5? like in VBA you could start from A1 and do xldown, xlright...

abdulaimohamed
Автор

At work I have all these different excel spreadsheets I need scan through for information. I want to create a prompt that ask for the name of the user and scans through these excel spreadsheets n then shows me predetermined useful information I would need.. is this possible with python?

mypalsdontcallme
Автор

Will this work with Excel 2007, do you know? Thanks.

TheNeilsolaris
Автор

can i also put formula and return the value instead of none?

leonardrutaquio
Автор

Could this work with LibreOffice Calc as well? Thank you for your reply...

rauldempaire
Автор

How to bring it to foreground instead just opening in the background... Please Help....

umakanthsahu
Автор

Could you pls tell how do you add custom calculation on pivot table via win32com? i mean the usage of

soniathomase