Examples

A great way to get started with xlwings Server is to try out the examples, with their source code available here:

Below are instructions on how to play around with them depending on which Excel integration you’re using.

Office.js add-ins

  • Custom scripts: you can click the Hello World buttons on the ribbon and on the task pane. For an explanation of how everything works, have a look at Custom Scripts.

  • Custom functions: in a cell, type: =XLWINGS.HELLO("world") (“prod” environment) or =XLWINGS_DEV.HELLO("world") (“dev” environment). You should see: Hello world!. There are quite a few other (more interesting) examples available that you see when typing =XLWINGS. or =XLWINGS_DEV. respectively. You can also look at app/custom_functions/examples.py.

  • Task pane: every directory in app/templates/examples corresponds to an example and has an own README with instructions.

VBA, Office Scripts, and Google Apps Script

These integrations only support custom scripts. Please have a look at the respective tutorial on how to run the hello_world example:

How to disable the examples

Once you have your own code, you can switch off all examples via the following config:

XLWINGS_ENABLE_EXAMPLES=false