Hello,
I have an excel vba file that imports dBase data by query. Now the strange
thing is that on new pc's the program does not run any more.
Still the same version of office.
The vba script gets stuck at the following code:
With ActiveSheet.QueryTables.Add(Connection:=Array( _
"OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=" & strPad & ";Mode=Share Deny Write;Extended Properties=""""" _
, _
";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=18;Jet OLEDB:Datab" _
, _
"ase Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="""";J" _
, _
"et OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Co" _
, "mpact Without Replica Repair=False;Jet OLEDB:SFP=False"), Destination:= _
Range("A1"))
.CommandType = xlCmdTable
.CommandText = Array(strBestand)
.Name = strBestand
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.SourceDataFile = strPad & strBestand
.Refresh BackgroundQuery:=False <--------
End With
This is error code i receive:
"The query cannot be executed, or the databasetabel can not be opened"
Is anyone familiar with this problem? I've tried office settings, references and plugins but i can't seem to find the problem.
Thanks in advance
Bookmarks