Error Code 438 - Object doesn't support....

excelbytes

Active Member
Joined
Dec 11, 2014
Messages
251
Office Version
  1. 365
Platform
  1. Windows
I wrote VBA code for sorts a list of names in a table. It runs fine on my computer using Microsoft 365, but won't run on a computer using Excel 2010. There are other macros that run fine, just this one is an issue. Is there a property of method that I'm using in the code that wasn't available in Excel 2010? I highlighted the line of code that causes the error.
VBA Code:
Sub SortMembers()
'
' SortMembers Macro
    
    ActiveSheet.Unprotect Password:="JesusLovesMe"
    Range("A3").Select
    Range(Selection, Selection.End(xlDown)).Select
    ActiveWorkbook.Worksheets("Individual Contributions").ListObjects("Table1"). _
        Sort.SortFields.Clear
[B][COLOR=rgb(184, 49, 47)]    ActiveWorkbook.Worksheets("Individual Contributions").ListObjects("Table1"). _[/COLOR][/B]
[COLOR=rgb(184, 49, 47)][B]        Sort.SortFields.Add2 Key:=Range("Table1[Members]"), SortOn:=xlSortOnValues _[/B][/COLOR]
[B][COLOR=rgb(184, 49, 47)]        , Order:=xlAscending, DataOption:=xlSortNormal[/COLOR][/B]
    With ActiveWorkbook.Worksheets("Individual Contributions").ListObjects("Table1" _
        ).Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="JesusLovesMe"
End Sub
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Try using Sort.SortFields.Add etc etc instead of .Add2
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,172
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top