johnaubreymoore
New Member
- Joined
- Nov 13, 2018
- Messages
- 1
Hello All,
I'm new to this forum so I hope I am posting this in the right local. I'm at my wits' end with a macro designed to pull from Access.
I'm receiving Run-Time Error '1004': Application defined or object-defined error
The debugger selects ".Refresh BackgroundQuery:=False" at the bottom of this chunk of code.
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:=Array( _
"OLEDB;Provider=Microsoft.ACE.OLEDB.12.0;Password="""";User ID=Admin;Data Source=X:\GBS_FO_AR_ARS_ReceivablesReporting\2_Queries\Aging Da" _
, _
"tabase 2.0_Coree6.accdb;Mode=ReadWrite;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:" _
, _
"Database Password="""";Jet OLEDB:Engine Type=6;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Glo" _
, _
"bal Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=Fal" _
, _
"se;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False;Jet OLEDB:Sup" _
, _
"port Complex Data=False;Jet OLEDB:Bypass UserInfo Validation=False;Jet OLEDB:Limited DB Caching=False;Jet OLEDB:Bypass ChoiceFie" _
, "ld Validation=False"), Destination:=Range("$A$1")).QueryTable
.CommandType = xlCmdTable
.CommandText = Array("qry_Unapplied")
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.SourceDataFile = _
"X:\GBS_FO_AR_ARS_ReceivablesReporting\2_Queries\Aging Database 2.0_Coree6.accdb"
.ListObject.DisplayName = "Table_Aging_Database_2.0_Coree6.accdb"
.Refresh BackgroundQuery:=False
I am relatively inexperienced when it comes to VB so any help would be greatly appreciated. Thank you!
I'm new to this forum so I hope I am posting this in the right local. I'm at my wits' end with a macro designed to pull from Access.
I'm receiving Run-Time Error '1004': Application defined or object-defined error
The debugger selects ".Refresh BackgroundQuery:=False" at the bottom of this chunk of code.
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:=Array( _
"OLEDB;Provider=Microsoft.ACE.OLEDB.12.0;Password="""";User ID=Admin;Data Source=X:\GBS_FO_AR_ARS_ReceivablesReporting\2_Queries\Aging Da" _
, _
"tabase 2.0_Coree6.accdb;Mode=ReadWrite;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:" _
, _
"Database Password="""";Jet OLEDB:Engine Type=6;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Glo" _
, _
"bal Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=Fal" _
, _
"se;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False;Jet OLEDB:Sup" _
, _
"port Complex Data=False;Jet OLEDB:Bypass UserInfo Validation=False;Jet OLEDB:Limited DB Caching=False;Jet OLEDB:Bypass ChoiceFie" _
, "ld Validation=False"), Destination:=Range("$A$1")).QueryTable
.CommandType = xlCmdTable
.CommandText = Array("qry_Unapplied")
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.SourceDataFile = _
"X:\GBS_FO_AR_ARS_ReceivablesReporting\2_Queries\Aging Database 2.0_Coree6.accdb"
.ListObject.DisplayName = "Table_Aging_Database_2.0_Coree6.accdb"
.Refresh BackgroundQuery:=False
I am relatively inexperienced when it comes to VB so any help would be greatly appreciated. Thank you!