Runtime Error 448: “Named argument not found,” explained and fixed

Error 448, “Named argument not found”, fires when a call supplies a named argument whose name does not exist in the method's parameter list. The name may be misspelled, remembered from a different method, or correct for another version of the library where the parameter was named differently. Unlike error 446, where the object cannot take names at all, here names are welcome and this one is simply not among them. It is a small error with an exact fix: use the parameter's real name, or call positionally.

For people who just run the program

  1. This is a code defect discovered at run time. It appears in macros calling library or application methods with labeled arguments; one label is wrong.
  2. Note the feature in use. The feature identifies the method whose argument name is wrong.
  3. Version changes are the usual backstory. If it started after an upgrade, a parameter was likely renamed or removed in the new object model; report the upgrade alongside the error.
  4. Nothing in the document affects it. The same call fails identically on every file.

For people who write the code

  1. Check the name against the actual signature. IntelliSense shows the real parameter names as you type; the Object Browser shows them for the referenced version. Trust those over memory, other examples, and the same method in a different library.
  2. ' ws.ExportAsFixedFormat Type:=xlTypePDF, Filename:=path, _
    '     Quality:=xlQualityStandard
    ' If the referenced version names it differently (or lacks it),
    ' the call raises error 448 on the unknown name.
  3. Distinguish optional-parameter myths. A parameter that exists in the documentation for a newer version does not exist in the installed one. Named arguments are validated against the referenced library, not against the latest documentation.
  4. Consider positional calls for cross-version code. Where a macro must run against several versions of a library, calling positionally with the common subset of parameters avoids name validation entirely and makes version differences explicit.
A named argument that “worked yesterday” indicts the reference, not the spelling. If nobody edited the call, then what changed is the library it binds to: an upgraded application, a swapped reference, a different machine. Diff the environment before diffing the code.

If it still happens

If the name matches the Object Browser exactly and 448 still fires, the call may be resolving to a different method than intended: an overloaded name in the library, or a same-named method on a base interface with fewer parameters. Qualify the object reference with the concrete class so the intended signature is the one validated.

Common questions

How is error 448 different from error 446? 446 means the object does not support named arguments at all. 448 means named arguments are supported but the specific name used is not a parameter of that method.

Can Option Explicit or compiling catch error 448? Compiling with an early-bound reference does catch unknown named arguments before run time. With late binding (Object variables), names can only be checked when the call executes, which is when 448 appears.

Related errors

Runtime Error 449 · Runtime Error 446 · Runtime Error 450