Caution
Use https://github.com/xlwings/xlwings-server instead
This sample works with:
- Excel on Windows
- Excel on macOS
- Excel on the web
- Google Sheets
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 runpython 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 rundocker compose up
.
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:
- 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
-
Excel (via VBA):
- Local: Once the server is running, you can click the button directly.
- GitPod: Open the VBA editor via
Ctrl-F11
(Windows) orCmd-F11
(macOS) and replace the URL inRunRemotePython
with the respective URL that GitPod prints.
-
Excel (via Office Scripts):
- Local: You will need to use a tool like ngrok to expose your local server to the internet, see https://docs.xlwings.org/en/latest/pro/server/server.html#part-i-backend
- GitPod: In Excel's
Automate
tab, click onNew Script
. Replace the content of the script with the content ofjs/xlwings_excel.ts
as you find it in GitPod.Save
the script, then click onRun
.
-
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):
- Local: You will need to use a tool like ngrok to expose your local server to the internet, see https://docs.xlwings.org/en/latest/pro/server/server.html#part-i-backend
- GitPod: Click on
Extensions
>Apps Scripts
. Replace the code in the fileCode.gs
with the code injs/xlwings_google.js
. Then hit theRun
button.
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).