Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.dotnet.languages.vb,microsoft.public.vb.ole.automation,microsoft.public.vb.ole
|
|||
|
|||
Can't create AutoFiltered Excel worksheet using VB.NET
I am trying to create a workbook where one of the worksheets contains
an AutoFiltered table. It looks like it should be simple -- what I am doing is this: rng = ws.Range("MyTableRange") rng.AutoFilter() Unfortunately I get an exception on the second statement, with the unhelpful message: AutoFilter method of Range class failed The range is rectangular, and contains a legitimate table, with column headers in the first row and data in most of the cells. If I create the workbook without calling the AutoFilter statement, then manually go to the range in question and set AutoFilter from the Excel Data menu, it works as expected. The worksheet is intended to be protected, but protection has not yet been set at the point where I try to set AutoFilter. I Googled for this, and found two other people complaining of the same thing, with no answers. I suspect (and hope!) this means that there is an answer -- otherwise there would be many more queries. Any help would be gratefully appreciated! -- John Brock |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I create GST worksheet in excel | New Users to Excel | |||
How do I create a worksheet within a worksheet in Excel? | Excel Worksheet Functions | |||
create linked autofiltered sheets? | Links and Linking in Excel | |||
Create new excel worksheet | Excel Programming | |||
Create Excel Worksheet in C# / VB | Excel Programming |