Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sajjad425/excel_to_pdf
This Python script uses the win32com module to automate Microsoft Excel and convert an Excel worksheet into a PDF file.
https://github.com/sajjad425/excel_to_pdf
exceltocsv exceltopdf jupyter-notebook python python-script python3
Last synced: 19 days ago
JSON representation
This Python script uses the win32com module to automate Microsoft Excel and convert an Excel worksheet into a PDF file.
- Host: GitHub
- URL: https://github.com/sajjad425/excel_to_pdf
- Owner: sajjad425
- Created: 2024-09-05T19:59:23.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-17T18:30:08.000Z (2 months ago)
- Last Synced: 2024-10-10T17:21:27.494Z (about 1 month ago)
- Topics: exceltocsv, exceltopdf, jupyter-notebook, python, python-script, python3
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Excel to PDF Conversion Script
This Python script automates the conversion of an Excel worksheet to a PDF file using the `win32com` module, which allows interaction with Microsoft Excel through the COM interface. It begins by importing the necessary library and launching Excel in the background without making it visible to the user. The script then specifies the path for the Excel file to be converted and the destination path where the resulting PDF will be saved. It opens the specified Excel file, selects the first worksheet, and exports it as a PDF to the designated location. After the conversion is complete, the script closes the Excel file and quits the Excel application to free up system resources. Finally, it prints a message confirming that the PDF has been successfully created and saved. This script streamlines the process of converting Excel files to PDFs, eliminating the need for manual intervention.
## Output
![exceltopdf](https://github.com/user-attachments/assets/ed1790c8-2b84-4d96-89a7-8999fc2cd11f)