每一次运行到最后的时候 Refresh BackgroundQuery:=False就出错
但我在调试时,按每一步执行就没有错, 请问有什么办法能解决?谢谢Application.WindowState = xlNormal
    With ActiveSheet.QueryTables.Add(Connection:= _
        "ODBC;DSN=xt;UID=sa;PWD=xxx;APP=Microsoft Office XP;WSID=GZ-DATEBASE;DATABASE=tg" _
        , Destination:=Range("A1"))
        .CommandText = Array( _
        "SELECT resource.gettime, resource.resourcenumber, resource.ordername, resource.state, resource.memo" & Chr(13) & "" & Chr(10) & "FROM tg.dbo.resource resource" & Chr(13) & "" & Chr(10) & "WHERE (resource.gettime>={ts '2003-06-10 00:00:00'} And resource.get" _
        , "time<{ts '2003-06-19 00:00:00'})" & Chr(13) & "" & Chr(10) & "ORDER BY resource.gettime")
        .Name = "&sup2;é&Ntilde;&macr;&Agrave;&acute;×&Ocirc; xt"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = True
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .PreserveColumnInfo = True
        .Refresh BackgroundQuery:=False
    End With