Python API - xlwings Documentation
docs.xlwings.org › en › stablePython API¶ Top-level functions¶ xlwings. load (index = 1, header = 1, chunksize = 5000) ¶ Loads the selected cell(s) of the active workbook into a pandas DataFrame. If you select a single cell that has adjacent cells, the range is auto-expanded (via current region) and turned into a pandas DataFrame.
Debugging - xlwings Documentation
https://docs.xlwings.org/en/stable/debugging.htmlDebugging¶. Since xlwings runs in every Python environment, you can use your preferred way of debugging. RunPython: When calling Python through RunPython, you can set a mock_caller to make it easy to switch back and forth between calling the function from Excel and Python.. UDFs: For debugging User Defined Functions, xlwings offers a convenient debugging server
User Defined Functions (UDFs) - xlwings Documentation
docs.xlwings.org › en › stableimport xlwings as xw @xw.func def double_sum(x, y): """Returns twice the sum of the two arguments""" return 2 * (x + y) Now click on Import Python UDFs in the xlwings tab to pick up the changes made to myproject.py. Enter the formula =double_sum (1, 2) into a cell and you will see the correct result: The docstring (in triple-quotes) will be ...
Connect to a Book — xlwings dev documentation
docs.xlwings.org › en › 0Excel to Python (RunPython)¶ To reference the calling book when using RunPython in VBA, use xw.Book.caller(), see Call Python with “RunPython”.Check out the section about Debugging to see how you can call a script from both sides, Python and Excel, without the need to constantly change between xw.Book.caller() and one of the methods explained above.
Quickstart - xlwings Documentation
docs.xlwings.org › en › stableimport xlwings as xw import pandas as pd @xw. func @xw. arg ('x', pd. DataFrame ) def correl2 ( x ): # x arrives as DataFrame return x . corr () Import this function into Excel by clicking the import button of the xlwings add-in: for a step-by-step tutorial, see User Defined Functions (UDFs) .