Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The first version of creating an autofilter in Excel works fine, but why do I
get an exception on the second version? I am coding in VB.NET (VB 2005). (I would like to compile my code with option strict set to ON and then only the second version does compile) ... excelWorksheet.Activate() ' VERSION 1: the following 3 lines work fine Dim range1 As Excel.Range = excelWorksheet.Range("A:A") range1.Select() excelWorksheet.Application.Selection.AutoFilter() ' VERSION 2: throws an Exceptions Dim range2 As Excel.Range = CType(excelWorksheet.Range("B:B"), Excel.Range) range2.Select() Dim rangeSel As Excel.Range = CType(excelWorksheet.Application.Selection, Excel.Range) rangeSel.AutoFilter() ' Exception: "AutoFilter method of Range class failed" Help would be appreciated! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
AutoFilter method of Range class failed | Excel Programming | |||
Autofilter method of range class failed | Excel Programming | |||
Insert method of range class failed | Excel Programming | |||
Insert method of range class failed | Excel Programming | |||
AutoFilter method of Range Class Failed | Excel Programming |