Error 438 means the code calls a property or method the object doesn’t have. A misspelling causes it, as in Worksheets("Data").Rnage("A1"), and so does a member that belongs to a different object, as in Worksheets("Data").Save, where Save is a workbook method. Use ThisWorkbook.Save instead.
VBA reports it only while the code runs, and only for objects it can’t check in advance: ActiveSheet, Worksheets(...), Sheets(...) and variables declared As Object. Declare a typed variable, as in Dim ws As Worksheet, and Debug → Compile VBAProject catches the same mistake as “Method or data member not found” before the code runs.
Type a dot after a typed object to see the members it supports, or press F2 in the Visual Basic Editor to search them in the Object Browser.
The error also appears when code uses something newer than the Excel it runs in. Application.XLookup works in Excel 365 and 2021 but stops with error 438 in Excel 2019 and earlier, so check Application.Version before calling newer functions.
VBA error 438 occurs when you try to use a property or method that does not support by that object. as you know all objects have some properties and methods that you can use but there could be a situation when using a property or method that does not apply to a particular object.
Let’s take an example to understand this: with the worksheet object there comes up a method to select the worksheet.

Now as you know you can activate a workbook but there is no method that you can use to select a workbook because you cannot select a workbook, you can only activate it.

So when you try to use this method with the workbook object you’ll get the runtime error 438. Even you can see this method is not in the list of properties and methods of the workbook object.

Now you can understand that it can be a mistake on the end of the person who writes the code and can be committed even if you are proficient in VBA.
Note: When you have written a code in the latest version of Microsoft Excel and now you try to run it in an older version, there could be a chance that that version doesn’t have a method or a property for the object you are using.
How to Fix an Object Doesn’t Support this Property or Method
The best way to deal with this error 438 (Object Doesn’t Support this Property or Method) you need to be aware of the properties and methods that are supported by the object you are using.
When you define an object, you can see the list of all the properties and methods when you type a dot (.).

This list can help you to decide if the method you want to use is there or not. And if it’s not there you need to find a different way to write a code for the task that you want to accomplish. Otherwise, you can also open the object browser (F2) to see the properties and methods you have with an object.
Written by
Puneet Gogia
Microsoft MVP — Excel · Founder, Excel Champs
Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.