Question : ODBC Access Driver  - Connection for viewing linked Excel worksheet lost AND "File Now Available" pop up

I have an Excel report - 6 worksheets.  1 that has cells to input a date range.  MS Access is linked to these dates and uses them as criteria to run the database queries on the other 5 worksheets.  I use a macro behind a button to save the workbook and refresh the queries.  Sometimes (in the morning) it works fine.  Other times, it gives me the ODBC error message above.  Attached is a screen shot of the ODBC Data Source set up.  The Macro code is below.  I added the wait time hoping that would help...

May or may not be related but often, when I close it, for no apparent reason, it will re-open with a "File Now Available" window saying that it is now available for Read-Write editing.  When it was open previously, it WAS exclusive, not Read Only.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
Sub Update()
    ActiveWorkbook.Save
    Sheets("Planning").Select
    Range("A5").Select
    Application.Wait (Second(Now()) + 5)
    ActiveSheet.PivotTables("POPivot").PivotCache.Refresh
    Range("A12").Select
     Application.Wait (Second(Now()) + 5)
    ActiveSheet.PivotTables("LinePivot").PivotCache.Refresh
    Range("B17").Select
     Application.Wait (Second(Now()) + 5)
    ActiveSheet.PivotTables("SOPivot").PivotCache.Refresh
    Range("B23").Select
     Application.Wait (Second(Now()) + 5)
    ActiveSheet.PivotTables("ProdPivot").PivotCache.Refresh
    Sheets("POs").Select
     Application.Wait (Second(Now()) + 5)
    Selection.QueryTable.Refresh BackgroundQuery:=False
    Sheets("Production").Select
    Selection.QueryTable.Refresh BackgroundQuery:=False
    Sheets("Picks").Select
    Selection.QueryTable.Refresh BackgroundQuery:=False
    Sheets("SOs").Select
    Selection.QueryTable.Refresh BackgroundQuery:=False
    Sheets("DateRange").Select
    Range("A2").Select
End Sub
Open in New Window Select All

Answer : ODBC Access Driver  - Connection for viewing linked Excel worksheet lost AND "File Now Available" pop up

Unfortunately, no one was ever able to help with this.
Random Solutions  
 
programming4us programming4us