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 PillowFollow these steps to run the program:
-
Install Dependencies: If you are using Linux or macOS, replace the
close_program_by_namefunction inopen-screenshot-close.pywith the code provided inclose.py. -
Configure File Paths: Set the values of
base_file_pathandbase_store_screenshot_pathinopen-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.pyThis script simplifies the process of opening, capturing, and closing an Excel file, streamlining your workflow for taking screenshots of specific Excel sections.