This guide explains how to set up and run the Ablieferungsmakro Python application.
- Python 3.11.x (64-bit)
- Windows operating system
- Microsoft Excel installed (required for
xlwings) - Microsoft Word installed (required for
pywin32Word automation) - Python library
openpyxl(for Excel file handling)
Follow these steps to set up the environment and run the application:
-
Open a terminal or PowerShell in the
Skriptsfolder of the project. -
Create a virtual environment named
.venv:python -m venv .venv -
Activate the virtual environment:
./.venv/Scripts/Activate.ps1
-
Install required packages:
python -m pip install pywin32 xlwings openpyxl -
(Optional) If running on DAP or another system, edit
.venv\pyvenv.cfgand adjust the paths to point to the correct Python installation. This ensures the virtual environment works correctly in that system. -
Now you can launch the Ablieferungsmakro and all functions should be available.
- Always ensure Excel and Word are installed and accessible.
- If file paths change (e.g., moving the script or data files), update the paths in
pyvenv.cfgin the .venv folder. - The application interacts with Excel sheets and Word documents, so make sure all required files exist at the specified paths.
- When you run the script for the first time, a message will appear asking if you trust the publisher and want to run the script. You need to choose A for Always so that this message will not appear again.
- Open terminal in
Skriptsfolder python -m venv .venv./.venv/Scripts/Activate.ps1python -m pip install pywin32 xlwings- (Optional) Adjust
.venv\pyvenv.cfgif running on DAP or another system - Run the Ablieferungsmakro.xlsm
Project Root │ ├── Ablieferungsmakro.xlsm ├── Skripts │ ├── .venv │ ├── main.pyz │ └── config.py ├── Daten │ └── Stammdaten.xlsx ├── Glossar │ └── Glossar.xlsx ├── Generierte Dokumente │ └── (empty folder for generated documents) ├── Vorlagen ├── Ablieferungsvereinbarung.docx ├── Ablieferungsverzeichnis.xlsx ├── Aktenangebotsformular.docx └── Angebotstabelle.xlsx