All my macros are receiving Automation error when performing sort functions

clovely

New Member
Joined
Jun 9, 2021
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Today when I when I run macros that worked fine yesterday(and several months before) they throw this error when they hit a sort operation:

1623272174484.png


Here is a sample of the code that is errors. The orange code is highlighted yellow in the VBA editor when I debug:

vEnd = Range("B65536").End(xlUp).Row
ActiveWorkbook.Worksheets("Backlog").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Backlog").Sort.SortFields.Add Key:=Range( _
"C4:C" & vEnd), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers


Any previously fine macro that has a sort operation is throwing this error. Also if I record a new macro and sort a file then try to rerun that macro I will get the same error. I tried doing a repair on my Office and still get the error. I am currently stuck and not sure what to try to fix this.

This is on a Windows 10 PC running Office 365.
 
Our local IT guy had me delete the Excel folder in the registry and that seems to have fixed my issue:
1623771872387.png


I will continue using Excel for the day and see if this issue is truly resolved and update this post.
 
Upvote 0
Solution

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
The deletion of the Excel file in the registry has fixed my issues. I will note that this set all the options to default, but did not remove my custom ribbon or my personal macros.

Thanks everyone for your assistance. Several good ideas were given and tried.
 
Upvote 0

Forum statistics

Threads
1,214,405
Messages
6,119,320
Members
448,887
Latest member
AirOliver

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