I need the following filter to work in C#.
Here is the working Macro in Excel VBA:
Here is what I thought was the C# equivalent:
But I get the following runtime error in C#:
System.Runtime.InteropServices.COMException: '_AutoFilter method of Range class failed'
Here is the working Macro in Excel VBA:
C#:
ActiveSheet.Range("$A$1:$XFC$13214").AutoFilter Field:=6, Criteria1:= ">=1/1/2024", Operator:=xlAnd, Criteria2:="<=1/31/2024"
Here is what I thought was the C# equivalent:
C#:
excelRange.AutoFilter(Field: 6, Criteria1: ">=1/1/2024", Operator: Microsoft.Office.Interop.Excel.XlAutoFilterOperator.xlAnd, Criteria2: "<=1/25/2024");
But I get the following runtime error in C#:
System.Runtime.InteropServices.COMException: '_AutoFilter method of Range class failed'