CALL Function

Excel Functions › User defined

All versions (add-in) User defined

The Excel CALL function invokes a procedure inside a dynamic link library (DLL) or code resource — or a procedure previously registered with REGISTER / REGISTER.ID. It is an advanced, macro-era function that runs external code, so it is disabled or tightly restricted in most modern, security-hardened Excel installations.


Quick answer:
=CALL(register_id, arg1, arg2) runs a previously registered external procedure

Syntax

=CALL(register_id, [arguments...]) — or — =CALL(module_text, procedure, type_text, [arguments...])
ArgumentDescription
register_id / module_textRequiredEither the register ID returned by REGISTER / REGISTER.ID, or the name of the DLL / code resource that contains the procedure.
procedureOptionalThe name (or ordinal) of the procedure within the DLL. Used only in the form that registers and calls in one step.
type_textOptionalA text string describing the data types of the return value and each argument the external procedure expects.
arguments, ...OptionalThe values passed to the external procedure, matching the types given in type_text.

How to use it

CALL is part of Excel's legacy macro-sheet function family. It exists to hand data to compiled code in a DLL or code resource and read the result back — the kind of thing that, today, is done with VBA, an Office Add-in, or an XLL written against the modern C API.

It is normally paired with REGISTER.ID: you register the external procedure once to get a register ID, then pass that ID to CALL.

=REGISTER.ID("MyLib.dll","DoWork") // returns a register ID
=CALL(register_id, 42) // runs DoWork(42) via that ID

This is a security-sensitive function. Because CALL can execute arbitrary native code, modern Excel blocks it in ordinary worksheet cells — it generally works only from within an XLL or a macro sheet and is often disabled entirely by Trust Center / IT policy. In a normal worksheet you will usually get an error, and you should not rely on it for everyday work.

If you are looking at an old workbook that uses CALL, the practical modern replacements are VBA, a JavaScript Office Add-in, or a properly built XLL add-in — not CALL in a cell.

Try it: interactive demo

Live demo

Pick a CALL example to see the formula and its result.

Result:

Practice workbook

📊
Download the free CALL practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

Is CALL safe to use, and will it work in my worksheet?
In practice, no — not as a normal worksheet formula. CALL runs external native code, so modern Excel restricts it to XLLs and macro sheets and IT policy frequently disables it outright. Typing it into an ordinary cell usually returns an error. Treat it as a legacy / developer feature, not something for day-to-day spreadsheets.
Why do I get an error when I use CALL?
Common causes: the function is blocked by security settings (most likely), the referenced DLL or procedure does not exist or is the wrong bitness (32- vs 64-bit), the register ID is invalid, or the type_text does not match the procedure's real signature. Because the call reaches outside Excel, the failure modes are stricter than a normal formula.
Do I need an add-in or anything special to use CALL?
You need the external DLL or code resource you intend to call, and your environment must permit it (Trust Center settings, and typically an XLL or macro-sheet context rather than a bare worksheet cell). There is no simple checkbox add-in that turns CALL into an everyday worksheet function.
What replaced CALL? What should I use instead?
CALL dates from the macro-sheet era. Modern equivalents for running custom code from Excel are VBA for in-workbook automation, a JavaScript Office Add-in for cross-platform add-ins, or an XLL built against Excel's C API for high-performance native functions. For most data tasks, LAMBDA and Power Query remove the need for external code altogether.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: REGISTER.ID · EUROCONVERT · INDIRECT · HYPERLINK · LAMBDA