Runtime Error 438 in VBA: “Object doesn't support this property or method”

Error 438 means the object is real, but the member being used on it isn't: the code called a property or method that this kind of object doesn't offer. It's the object-oriented cousin of a spelling error — with two extra causes: the variable holds a different object than the code assumes, or the Office version in use genuinely lacks that member.

The usual causes, most common first

  1. A misspelled property or method name — VBA can't check names on late-bound objects at compile time, so typos survive until the line runs.
  2. The variable holds a different object than expected — a Range where a Worksheet was assumed, a Workbook method used on a Sheet. The member exists — on the other object.
  3. Late binding hiding the truth: variables declared As Object or Variant skip IntelliSense and compile checks, letting wrong members through.
  4. Version differences — a property added in a newer Office (or removed from an older one); the macro was written against a different Excel than the one running it.
  5. A similar-but-wrong member — .Value2 vs .Value, worksheet functions vs VBA methods, Cells vs Range habits imported from another object model (Word code used in Excel is a classic).

The fix

  1. Ask the object what it is. On the failing line, Immediate window: ? TypeName(myVar). Half of all 438s end here — the object isn't what the code believes.
  2. Bind early while developing: declare the specific type (Dim ws As Worksheet) and reference the library (Tools → References). IntelliSense then lists only real members, and the compiler catches wrong ones before runtime.
  3. Check the member against the rightful owner — search the object model for the property's actual parent. Sort lives on Range, not Worksheet; knowing the owner is the fix.
  4. Confirm the Office version if the member is legitimately documented: features arrive per version, and a macro using a 365-only member will 438 faithfully on Excel 2016 forever. Either avoid the member or version-gate it.
Do not download anything for this error. Nothing external is missing (that's error 429's territory). Here, a name, a type, or a version inside the code's own world is mismatched.

If it still happens

Isolate the call in the Immediate window against a known object: create the object fresh (Set x = Worksheets(1)) and try the member there. If it works, the original variable's content is the problem; if it fails identically, the member truly doesn't belong to that object in this version — and the documentation for your exact Office version is the referee.

Common questions

What's the difference between 438 and 424/91? 424/91 mean the variable holds nothing at all. 438 means it holds a real object — just not one that offers the member being used. TypeName() distinguishes them in one line.

Why did it compile fine if the member doesn't exist? Late binding. With Object/Variant variables, VBA defers member checks to run time by design — flexibility bought with exactly this error.

Related errors

Runtime Error 424 · Runtime Error 91 · Runtime Error 429