I have used PyXLL for several years. I tried the Anvil app yesterday and today.
First, I built an ‘Anvil only’ app – fairly straightforward, easy, seems to work as advertised – in conclusion, no issues.
Second, I built an ‘Anvil + PyXLL’ app – little bit tricky for me. Even after getting it to work, I have issues.
Here is my test server module (ServerModule1):
import anvil.server
from anvil_pyxll.server import xl_func
# This is a server module. It runs on the Anvil server,
# rather than in the user's browser.
#
# To allow anvil.server.call() to call functions here, we mark
# them with @anvil.server.callable.
# Here is an example - you can replace it with your own:
#
@xl_func
def ABCsay_hello(name_parameter):
return 42
@xl_func
@anvil.server.callable
def hypotx(a,b):
return (a**2 + b**2)**0.5
@xl_func
@anvil.server.callable
def subx_a_and_b(a,b):
return a-b
The code above works, PyXLL uses this code successfully. Actually, the ABCsay_hello function is recognized but returns an (#N/A) error in Excel.
Now, when the functions are edited, PyXLL/Excel does not recognize the changes. I’ve attempted several ways of forcing PyXLL/Excel to use the edited code.
run the edited app
republish the edited app
close the edited app
change the uplink token
deep reload of PyXLL/Excel
close Excel
restart the computer
Seems to me, something is broken in the PyXLL client to PyXLL server connection. Maybe I have something wrong in my setup.
Here is the link to the app online: BigTest (Anvil chose the name).
In the text area of the online app:
for e in anvil.server.call('pyxll.get_xl_funcs'):
txt = txt + str(e['func_name']) + ' \n'
txt = txt[:-1]
self.pyx_funcs_area.text = txt
the PyXLL functions are gathered and presented. This seems to prove that the PyXLL server is working correctly. My guess is that something is not working in the PyXLL client.