Results 1 to 4 of 4

Worksheets("NamedRange").ShowAllData Runtime error in 2007 but not 03

Threaded View

  1. #1
    Registered User
    Join Date
    01-09-2010
    Location
    WV
    MS-Off Ver
    Excel 2003 & Excel 2007
    Posts
    3

    Worksheets("NamedRange").ShowAllData Runtime error in 2007 but not 03

    Hi,

    I am somewhat new to vba. I have this code that works in Excel 2003.
    Sub UpdateSysInfo(ByVal SbTtl As Range, ByVal AFfld As Integer)
     
     Application.Calculation = xlCalculationManual
     Application.ScreenUpdating = False
     Application.EnableEvents = False
    
     Worksheets("SystemInfoReport").ShowAllData
     Worksheets("SystemInfoReport").Range("SysInfoDb").AutoFilter field:=AFfld, Criteria1:="<>"
     Application.EnableEvents = True
     Worksheets("SystemInfoReport").Calculate
        
    
    SbTtl.Value = Range("SysInfoAgencyNameSbTtl").Value
    
     End Sub
    But fails during compile in Excel 2007 with a Runtime error 1004 for "ShowAllData method of Worksheet class failed" with the following highlighted during debug "Worksheets("SystemInfoReport").ShowAllData"

    I have the workbook opened in 'compatablity mode' since it must now work in a 2003 environment, but occasionally do work like this offsite in a 2007 environment.

    I have googled and attempted to read up on this but still come up empty, so I would appreciate any help/insights.
    Last edited by royUK; 01-09-2010 at 10:58 AM. Reason: add code tags

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