+ Reply to Thread
Results 1 to 5 of 5

Excel 2003 Autofilter error?

  1. #1
    Forum Contributor
    Join Date
    07-24-2008
    Location
    Athome
    MS-Off Ver
    Excel 2013
    Posts
    127

    Excel 2003 Autofilter error?

    Hi all

    I have written a macro for which the code is shown below.
    Using excel 2007 but stored as .xls because an assistant user is gonig to use the workbook with excel2003.

    The assistant user is experiencing an error titled "Object doesn't support this property or method". I only have a screenshot of this error message. Unfortunately, the assistant sits in a different geographical location so I'm unable to observe the error or replicate it on my side.

    Compatibility checker in my excel shows taht there are NO ISSUES.
    The macro runs perfectly on my computer.

    Macro does the following (1) opens a .csv file, (2) copies all the content from the sheet, (3) switches back to my workbook, (4) inserts a new sheet, (5) pastes the data, (6) selects range (7) runs autofilter on 2 criteria (8) copies the filtered results (9) adds new sheet and pastes the copied data from (8).

    From the screenshot that was supplied to me, I can see that the code is executing up to this line, and then the error msg is displayed:

    'LastRow definition for imported bank statement
    LastRow = Sheets("Import").Cells(Rows.Count, "A").End(xlUp).Row


    This is where the error msgbox pops up.
    The screenshot shows all cells highlighted. If I run the code up to cursor at the end of this line, then on my screen the Excel spreadsheet looks the same as the screenshot.

    The next line of code goes on to the Autofilter.
    Columns("A:I").Select
    Selection.AutoFilter
    ActiveSheet.Range("$A$1:$I$" & LastRow).AutoFilter Field:=3, Criteria1:="="
    ActiveSheet.Range("$A$1:$I$" & LastRow).AutoFilter Field:=2, Criteria1:="<>"


    The screenshot does not show Columns A-I being selected.
    So I'm guessing that this Autofilter type is not supported in Excel 2003? But I can't seem to find any more info on internet search.

    Have checked Microsoft website here as advised by MarvinP.
    Also used Bing search but with no success.

    Here is the entire code -
    Please Login or Register  to view this content.
    Any suggestions?
    Last edited by rasonline; 03-11-2011 at 01:02 PM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Excel 2003 Autofilter error?

    What happens if you add a workbook reference to that line?

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Excel 2003 Autofilter error?

    Hi rasonline

    I believe I've encountered this issue in the past. Try creating the new sheet BEFORE the code to copy Filtered Data. Then do your copy paste.

    Something like this (NOT tested)
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Contributor
    Join Date
    07-24-2008
    Location
    Athome
    MS-Off Ver
    Excel 2013
    Posts
    127

    Re: Excel 2003 Autofilter error?

    Am checking on this today, and will update this post hopefully by tomorrow.

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Excel 2003 Autofilter error?

    hi, rasonline, may be I'm wrong but the root of the problem is not the marked line.

    As far as I can see the problem is here:

    Please Login or Register  to view this content.
    If you refer to Excel 2003 VB help file (you saved it as .xls definining Excel 2003 VB for this code) the Tab Object has the following properties:

    - Application property
    - Color Property
    - ColorIndex Property
    - Creator Property
    - Parent Property


    So .TintAndShade property is not used in Excel 2003. Solution: try to comment it out and run the code, I suppose it will run without any troubles.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1