Hi Joel........
Thanks for the comeback.....
Here's the code...
With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
"ODBC;DSN=MS Access Database;DBQ=" & NewFile & ";DefaultDir= " _
), Array( _
";DriverId=281;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;" _
)), Destination:=Range("A1"))
.CommandText = Array( _
"SELECT `NPR Database`.`Disposition Date`, `NPR
Database`.`Inspection Date`, `NPR Database`.`NPR Origin`, `NPR Database`.`NPR
Number`, `NPR Database`.`Part Number`, `NPR Database`.`Serial Number`, `NPR" _
, _
" Database`.`Vendor Code`, `NPR Database`.`Vendor Name`, `NPR
Database`.`No of Defects`, `NPR Database`.`Qty RTV`, `NPR Database`.`Defect
Description`, `NPR Database`.`Corrective Action`" & Chr(13) & "" & Chr(10) &
"FROM `" _
, _
"" & newfile2 & "`.`NPR Database` `NPR Database`" & Chr(13) & "" &
Chr(10) & "ORDER BY `NPR Database`.`Vendor Code`" _
)
.Name = "Query from MS Access Database"
.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
When failing, the bottom line, ".Refresh BackgroundQuery:=False" is the one
that's highlighted.....but then that's the case with almost any error within
this routine.
My "Error Trapping" setting is "Break on unhandled errors".....if my User's
computer has a different setting could that be the reason? (He's tied up
right now so I can't check his setting).
Like I said, the code works fine on my computer, just not on his.
Vaya con Dios,
Chuck, CABGx3