Python 3 Script to Convert MS Excel (XLSX) Documents to PDF Documents Using pywin32 (win32com) Module Full Project For Beginners

 

Welcome folks today in this blog post we will be converting ms excel (xlsx) documents to pdf documents using pywin32 (win32com) module in python 3.All the full source code of the application is shown below.

 

 

 

Get Started

 

 

 

In order to get started you need to install the below libraries using the pip command as shown below

 

 

pip install pywin32

 

 

After installing this libraries make an index.py file and copy paste the following code

 

 

index.py

 

 

# Import Module
from win32com import client

# Open Microsoft Excel
excel = client.Dispatch("Excel.Application")

# Read Excel File
sheets = excel.Workbooks.Open('Excel File Path')
work_sheets = sheets.Worksheets[0]

# Convert into PDF File
work_sheets.ExportAsFixedFormat(0, 'PDF File Path')

Leave a Reply