我今天在 Excel 2013 中遇到了类似的问题。来到这里,我注意到没有真正解决方案的老问题。
What I found out, is that the error does not appear when a range in the sheet with the filter is being selected. 因此,以下内容对我有用:
Sub Test()
'
' Test Macro
'
Dim wb As Workbook, wbSave As Workbook, _
ws As Worksheet, wsSave As Worksheet, rSel As Range
'don't annoy users with changing the selection
Application.ScreenUpdating = False
'save old selection values to be sure
Set wbSave = ActiveWorkbook
Set wsSave = ActiveSheet
Set rSel = Selection
'activate target workbook + select something
'in my case it's a sheet in the same test workbook
Set wb = Workbooks("requirement_spec.xls")
wb.Activate
Sheets("Filter").Select
Range("A11").Select
'apply filter now
Sheets("Requirements").Range("A4:BU279").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("A1:F5"), CopyToRange:=Range("A11"), Unique:=False
'restore old selection to be sure
wbSave.Activate
wsSave.Activate
rSel.Select
'allow screen updating again
Application.ScreenUpdating = True
End Sub