{"id":19815831,"url":"https://github.com/xeden3/docker-excel-macro-run","last_synced_at":"2026-04-02T02:06:57.672Z","repository":{"id":238887824,"uuid":"797870510","full_name":"xeden3/docker-excel-macro-run","owner":"xeden3","description":"This is a Docker container that runs Excel macros using Python win32 on a Wine and Office environment.","archived":false,"fork":false,"pushed_at":"2024-05-09T03:15:23.000Z","size":32,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-18T20:47:20.223Z","etag":null,"topics":["docker","excel","office","python","vba","win32com","wine"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xeden3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-08T16:41:55.000Z","updated_at":"2025-08-06T16:42:14.000Z","dependencies_parsed_at":"2024-05-11T23:31:38.325Z","dependency_job_id":null,"html_url":"https://github.com/xeden3/docker-excel-macro-run","commit_stats":null,"previous_names":["xeden3/docker-excel-macro-run"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xeden3/docker-excel-macro-run","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeden3%2Fdocker-excel-macro-run","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeden3%2Fdocker-excel-macro-run/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeden3%2Fdocker-excel-macro-run/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeden3%2Fdocker-excel-macro-run/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xeden3","download_url":"https://codeload.github.com/xeden3/docker-excel-macro-run/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeden3%2Fdocker-excel-macro-run/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","excel","office","python","vba","win32com","wine"],"created_at":"2024-11-12T10:07:18.422Z","updated_at":"2026-04-02T02:06:57.650Z","avatar_url":"https://github.com/xeden3.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Excel Macro Runner Docker (docker-excel-macro-run)\n\nThis Docker container provides a solution to run Excel macros using Python win32 on a Wine and Office environment. It supports installation via GitHub and Docker Hub. Below are the steps for installation and usage.\n\n### Installation\n\n#### GitHub Installation\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/xeden3/docker-excel-macro-run.git\n    cd docker-excel-macro-run\n    ```\n\n2. Build the Docker image:\n\n    ```bash\n    docker build -t docker-excel-macro-run:v1 .\n    ```\n\n#### Docker Hub Installation\n\nPull the Docker image directly from Docker Hub:\n\n```bash\ndocker pull xeden3/docker-excel-macro-run:v1\n```\n\n### Usage\n\nRun the Docker container with the following command:\n\n```bash\ndocker run -v ./example.xlsm:/opt/wineprefix/drive_c/test.xlsm --rm docker-excel-macro-run:v1 test.xlsm ThisWorkbook.WriteDataToSheet1\n```\n\nThe parameters explained:\n\n- `docker-excel-macro-run:v1`: Docker image name and tag.\n- `test.xlsm`: Name of the Excel file to run the macro on. It should match the filename in the container's directory (`/opt/wineprefix/drive_c/test.xlsm`).\n- `ThisWorkbook.WriteDataToSheet1`: Macro command to execute.\n\nThe output will be in JSON format:\n\n```json\n{\"errcode\": 0, \"errmsg\": \"\"}\n```\n\nYou can retrieve and print the output using:\n\n```bash\noutput=$(docker run -v ./example.xlsm:/opt/wineprefix/drive_c/test.xlsm --rm docker-excel-macro-run:v1 test.xlsm ThisWorkbook.WriteDataToSheet1)\necho $output\n```\n\n### Challenges\n\nThis Docker container addresses two main challenges:\n\n1. **Handling Errors with Chinese Programs**: Chinese characters are not recognized in the default Wine environment. Therefore, when macros contain Chinese or other languages, errors may occur. Installing the appropriate font library and changing the `locales` value can resolve this issue.\n\n    ![4ded46e3f2b401979a661154c2ef4c4](https://github.com/xeden3/docker-excel-macro-run/assets/38025067/53f29124-d5ad-4a47-837b-5badecbc7ab4)\n\n    To address this in Docker, the following steps are taken:\n\n    ```Dockerfile\n    RUN apt-get update \u0026\u0026 apt-get install -y locales\n    RUN sed -i -e 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen \u0026\u0026 \\\n        dpkg-reconfigure --frontend=noninteractive locales \u0026\u0026 \\\n        update-locale LANG=zh_CN.UTF-8\n    ENV LC_ALL=zh_CN.UTF-8\n    ```\n\n### Challenges (Continued)\n\nThis Docker container also addresses another significant challenge:\n\n2. **Suppressing xvfb-run Output**: During program execution, `xvfb-run` may output the following warning:\n\n    ```\n    X connection to :100 broken (explicit kill or server shutdown).\n    ```\n    ![image](https://github.com/xeden3/docker-excel-macro-run/assets/38025067/bb7777d0-ed07-48a7-8bbc-cca8da14413e)\n\n    To mitigate this, an `entrypoint.sh` file is added. This shell script filters out the warning message using the `grep` command. Failure to suppress this warning may result in numerous exception messages being returned.\n\n    Below is the code snippet used to suppress the warning:\n\n    ```bash\n    # Disable the 'X connection to :100 broken (explicit kill or server shutdown).' warning\n    xvfb-run -a wine python /opt/wineprefix/drive_c/app/excel_xlsm_macro_run.py \"$@\" | grep -v '100 broken'\n    ```\n\n    This command ensures that the warning message is filtered out from the output, providing a cleaner execution result.\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxeden3%2Fdocker-excel-macro-run","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxeden3%2Fdocker-excel-macro-run","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxeden3%2Fdocker-excel-macro-run/lists"}