Luau API
xllify.ExcelFunction()
Register a function for Excel, aka: xllify.fn
xllify.ExcelFunction(metadata, function_body)
xllify.fn(metadata, function_body)Metadata fields:
name(string) - Excel function name (e.g., "MyFunc")description(string) - Function description (optional)category(string) - Excel category (optional)execution_type(string) - "sync" or "async" (default: "sync")
xllify.ExcelFunction({
name = "ADD",
description = "Add two numbers",
category = "Math"
}, function(x, y)
return x + y
end)xllify.ExcelFunction({
name = "DELAYED_MESSAGE",
description = "Returns a message after a delay",
execution_type = "async"
}, function(seconds, message)
async.sleep(seconds) -- Non-blocking sleep
return message
end)Built-in properties
xllify.version
Get xllify version:
Async functions
Async functions (with execution_type = "async") can use non-blocking operations via the async namespace.
async.sleep()
Non-blocking sleep (async functions only):
Example:
async.http_get()
Non-blocking HTTP GET (async functions only, Windows only):
Returns a table with:
status- HTTP status codebody- Response body (if successful)error- Error message (if failed)
async.http_post()
Non-blocking HTTP POST (async functions only, Windows only):
Parameters:
url- URL to POST tobody- Request bodycontent_type- Content-Type header (optional, defaults to "application/json")
Returns same table structure as http_get().
Blocking functions
For non-async (sync) functions, blocking versions are available globally.
sleep()
Blocking sleep (sync functions only):
http.get()
Blocking HTTP GET (sync functions only):
http.post()
Blocking HTTP POST (sync functions only):
Standard libraries
All standard Luau libraries are available:
Logging
Use the log namespace to write log messages:
Excel types
Number
number
String
string
Boolean
boolean
Range
table (2D array)
Empty
nil
Error handling
Use error() to return errors to Excel:
Excel shows: #ERROR: Cannot divide by zero
Last updated