VBA & Macro Problems

Fix Excel VBA Object Does Not Support This Property or Method

Anum MushtaqAnum Mushtaq Oct 26, 2026 868 views

Question details

The user is encountering a VBA runtime error stating the object does not support the property or method when trying to refresh PivotTables via a UserForm macro.

How to Fix Excel VBA 'Object Does Not Support This Property or Method' Error
Product
Excel
Device & OS
not provided
Scenario
Running a macro from a UserForm to refresh multiple PivotTables across the workbook.
Observed behavior
The macro throws an object property or method error (Run-time error 438) because an incorrect member or method is being called on the PivotTable object.
Before you start

Before modifying your VBA code, open the VBA Editor and stop the macro execution if it is currently in debug mode. It is also highly recommended to save a backup of your workbook.

Solution 1Recommended

Update VBA Code to Use the RefreshTable Method

Resolve the error by replacing incorrect refresh commands with the supported `RefreshTable` method for PivotTable objects.

This runtime error occurs when you call a method or property that does not exist for the target object. In this scenario, attempting to use standard data refresh commands incorrectly on a PivotTable triggers the error. The correct method for PivotTables is RefreshTable.

1
Open the VBA Editor

Press `Alt + F11` on your keyboard to open the Visual Basic for Applications (VBA) Editor in Excel.

2
Locate the Macro

In the Project Explorer pane on the left, double-click the Module or UserForm that contains the problematic macro code.

3
Identify the Error Line

Find the loop or specific line of code that attempts to refresh the PivotTable. Ensure the variable in use is properly defined as a `PivotTable` object.

4
Apply the RefreshTable Method

Change the incorrect method call to `.RefreshTable`. For example, update your loop to: `For Each tblPivot In ActiveWorkbook.PivotTables`, followed by `tblPivot.RefreshTable`, and end with `Next tblPivot`.

5
Save and Test

Click the Save icon, close the VBA Editor, and trigger the macro from your UserForm again to verify the PivotTables refresh without returning an error.

Update VBA Code to Use the RefreshTable Method
Debugging Tip: You can use the built-in Object Browser (press F2) or IntelliSense in the VBA Editor to easily browse and confirm supported methods for any object in your code.
Free Microsoft Office alternative

Try WPS Office for a Seamless Spreadsheet Experience

Looking for a reliable, lightweight alternative to Microsoft Excel? WPS Office provides excellent format compatibility and a familiar interface without the heavy subscription costs.

Fully compatible with Microsoft Excel (.xlsx, .xls) and macro-enabled (.xlsm) formatsLightweight design ensures fast loading and smooth performance on older devicesFamiliar user interface requires zero learning curve for Excel usersBuilt-in advanced data analysis and PivotTable tools
microsoft office alternative - wps office

Frequently Asked Questions

What does Run-time error 438 mean in Excel VBA?

Run-time error 438 means 'Object doesn't support this property or method.' It happens when your VBA code tries to execute a command or read a property that the specific object (like a Range, Worksheet, or PivotTable) does not natively support.

How do I find the correct methods for a VBA object?

You can find correct methods by opening the VBA Editor and pressing F2 to access the Object Browser. Alternatively, you can rely on IntelliSense—the automatic dropdown menu that appears when you type a period after a properly declared object variable—to see a list of valid properties and methods.

Why does my code work in one UserForm but fail in another?

This often occurs due to scope issues or implicit references. If a UserForm refers to `ActiveSheet` instead of an explicitly named sheet, it might try to run the code on a worksheet where the target object doesn't exist or is of a different type. Always use explicit references, such as `Sheets("Data").PivotTables(1)`.