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.pyTask pane examples (only Office.js add-ins):
xlwings_server/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 Worldbuttons 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
xlwings_server/templates/examplescorresponds to an example and has an ownREADMEwith 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