Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

xlwings/xlwings-server-helloworld-fastapi

Repository files navigation

xlwings Server: Hello World

This sample works with:

  • Excel on Windows
  • Excel on macOS
  • Excel on the web
  • Google Sheets

Quickstart

Run backend server locally

This is a good option if you want to try the VBA client via Demo.xlsm.

  • Local Python installation: install the Python dependencies into a virtual env or Conda env by running pip install -r requirements.txt, then run python app/main.py to run the server
  • Docker: copy .env.template to .env and enter an xlwings (trial) license key. You can get one from here: https://www.xlwings.org/trial. Then run docker compose up.

Run backend server via Gitpod

This is a good option if you want to try out hte Excel Office Scripts or Google Apps Script clients.

  • Open this repo in GitPod:
    Open in Gitpod
  • When you open it the very first time, it will ask you to enter an xlwings (trial) license key. You can get one from here: https://www.xlwings.org/trial

Clients

  • Excel (via VBA):

    • Local: Once the server is running, you can click the button directly.
    • GitPod: Open the VBA editor via Ctrl-F11 (Windows) or Cmd-F11 (macOS) and replace the URL in RunRemotePython with the respective URL that GitPod prints.
  • Excel (via Office Scripts):

  • Excel (via Office.js Add-ins) For Office.js add-ins, please follow this repo instead: https://github.com/xlwings/xlwings-officejs-quickstart

  • Google Sheets (via Google Apps Script):

    If you run this the very first time, Google Sheets will ask you for the permissions it needs.

To learn about how to call your script from a button with Google Sheets or Excel on the web, have a look at the docs (link below).

Next Steps: