+ Reply to Thread
Results 1 to 2 of 2

import buming out now and then

  1. #1
    Forum Contributor
    Join Date
    12-20-2006
    Posts
    127

    import buming out now and then

    I am running a plasma screen using excel to display data that refreshes every 40 secs. This works fine apart from the fact that the below query bums out every now and then with a run time error. I have tried increasing the time out secs but this doesnt seem to have resolved it.

    Is there a way to get this to just skip the rest of the query and continue if it gets this issue without a error msg. That way it could just re run on the next loop.



    Sub Max_Plan_Date()
    '
    ' Max_Plan_Date Macro
    ' Macro recorded 13/02/2007 by Any Authorised Employee
    '
    Application.StatusBar = "Plan Date being obtained....."
    Sheets("PlanDate").Activate
    Cells.Delete
    '
    With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
    "ODBC;DSN=MS Access Database;DBQ=C:\Plasma\Hourly_Update.mdb;DefaultDir=C:\Plasma;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTi" _
    ), Array("meout=5;")), Destination:=Range("A1"))
    .CommandText = Array( _
    "SELECT dbo_v_max_planned.app_id, dbo_v_max_planned.Expr1" & Chr(13) & "" & Chr(10) & "FROM `C:\Plasma\Hourly_Update`.dbo_v_max_planned dbo_v_max_planned" _
    )
    .Name = "Query from MS Access Database"
    .FieldNames = True
    .RowNumbers = False
    .FillAdjacentFormulas = False
    .PreserveFormatting = True
    .RefreshOnFileOpen = False
    .BackgroundQuery = True
    .RefreshStyle = xlInsertDeleteCells
    .SavePassword = False
    .SaveData = True
    .AdjustColumnWidth = True
    .RefreshPeriod = 0
    .PreserveColumnInfo = True
    .Refresh BackgroundQuery:=False
    End With
    Range("B2").Copy
    Sheets("Dialler Stats").Activate
    Range("B1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Application.StatusBar = False
    End Sub

  2. #2
    Forum Contributor
    Join Date
    12-20-2006
    Posts
    127

    ps

    i did try upping the timeout secs but didnt make any diff

+ 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