In this repository, we provide a script that automates the process of opening an Excel file, capturing a screenshot of a specific Excel section, and then closing the Excel application. The results of running the open-screenshot-close.py
script can be found in the "done" folder.
Before running the open-screenshot-close.py
script, you need to install the Pillow
library. Please note that the closing part of the script is currently designed for Windows OS. To enable program closure on Linux and macOS, you should also install psutil
as follows:
pip install psutil
pip install Pillow
Follow these steps to run the program:
-
Install Dependencies: If you are using Linux or macOS, replace the
close_program_by_name
function inopen-screenshot-close.py
with the code provided inclose.py
. -
Configure File Paths: Set the values of
base_file_path
andbase_store_screenshot_path
inopen-screenshot-close.py
. -
Specify the Area for Screenshots: Define the region of the screen that you want to capture.
-
Execute the Script: Run the script using the following command:
python open-screenshot-close.py
This script simplifies the process of opening, capturing, and closing an Excel file, streamlining your workflow for taking screenshots of specific Excel sections.