Examples¶
A great way to get started with xlwings Server is to try out the examples, with their source code available here:
Custom scripts:
app/custom_scripts/examples.py
.Custom functions (only Office.js add-ins):
app/custom_functions/examples.py
Task pane examples (only Office.js add-ins):
app/templates/examples
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 atapp/custom_functions/examples.py
.Task pane: every directory in
app/templates/examples
corresponds to an example and has an ownREADME
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