foozball3000
Executive Member
- Joined
- Oct 28, 2008
- Messages
- 5,827
Our current method has a 50% fail ratio. And that doesn't work, because at both demos it failed. Embarrassing.
Currently, we're using this function in VBA to import a specific part of the dataset.
Is there another sensible way?
Currently, we're using this function in VBA to import a specific part of the dataset.
Code:
With ActiveSheet.QueryTables.Add( _
Connection:="ODBC;DBQ=Data;DefaultDir=;Driver={Microsoft Text Driver (*.txt; *.csv)};", _
Destination:=ActiveSheet.Range("A1"))
.CommandText = "SELECT * FROM TestDataset.txt WHERE [UserID] = '" & UserID & "'"
.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
On Error Resume Next
End With
Is there another sensible way?