Runtime Error 443: “Automation object doesn't have a default value,” explained and fixed

Error 443, “Automation object doesn't have a default value”, fires when code uses an object where a value is expected, and VBA's usual rescue, silently substituting the object's default property, is unavailable because this object has no default member. Assignments like x = obj, comparisons, and MsgBox obj all need a value; for many built-in objects a default property (Value, Text, Item) quietly provides one, which trains the habit. Automation objects from external libraries often define no default, and then the same habit raises error 443.

For people who just run the program

  1. This is a code defect with no user-side trigger. It appears when a macro works with objects from another library and treats one as a plain value; the documents involved are irrelevant.
  2. Note the feature. Reporting and export features that print or store “the object” instead of a property of it are the usual sites.
  3. Nothing to retry. The statement will fail identically until the code names a property.
  4. Report the number. 443 is specific enough that the maintainer can find the statement by searching for bare object uses.

For people who write the code

  1. Name the property you actually want. Replace every bare use of the object in a value context with the explicit member that holds the intended data:
  2. ' Set rs = OpenRecordset(...)
    ' total = rs                ' error 443 if the object has no default value
    total = rs.Fields("Total").Value   ' explicit: no default needed
  3. Know which of your objects have defaults. VBA and Office objects usually do (Range.Value being the famous one), which is why the bug survives testing against built-ins and only fires against a stricter external object.
  4. In your own classes, define a default member if value-like use is natural. A class representing a quantity or a text value should expose a default property so callers can use it naturally; a class representing a thing (a connection, a document) should not pretend to be a value.
Error 443 is the honest version of a silent bug. Where a default exists, using the bare object “works” while depending on which member happens to be default, a fact readers of the code cannot see. Explicit member names are better style even where 443 never fires.

If it still happens

If the object demonstrably has a default member in its documentation and 443 persists, the reference in hand may be to a raw interface or a forward-declared type where VBA cannot see the default. Declare the variable with the concrete class from the referenced library so the member metadata is available.

Common questions

What is a default value (default member)? A property or method designated as the one to use when an object appears where a value is expected. Range's Value is the everyday example: writing x = Range("A1") really means x = Range("A1").Value.

Why do external objects lack defaults more often? Because default members are a convention each library chooses. Many COM libraries, especially those designed for other languages, never designate one, so value-style use fails with error 443.

Related errors

Runtime Error 438 · Runtime Error 440 · Runtime Error 451