Auto filter not working

S

shantanu

hello

i am not able to achive auto filter. i am pasting the code below

private void FilterReport()
{
string bookPath = @"D:\Window Crawler\Test Data
\PatchMatrix.xls";
Excel.Workbook _repbook = OpenExcelWorkbook(bookPath);
Excel.Worksheet _shtrep = (Excel.Worksheet)
_repbook.ActiveSheet;

//_shtrep.AutoFilterMode = true;
_shtrep.EnableAutoFilter = true;

Excel.Range Rngrep = _shtrep.get_Range("E1",
Type.Missing);
Rngrep.Select();
Rngrep.AutoFilter(1, "<>",
Excel.XlAutoFilterOperator.xlAnd,Type.Missing,false);
}

it gives error : AutoFilter method of Range class failed

kindly help

Thanks
Shantanu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top