J
jordanctc
The following code was working on Friday but today on several computer
the VBA code has a big problem with the format function. I a
getting:
Microsoft Visual Basic
Compile Error
Wrong number of arguements or invalid property assignment.
With ActiveSheet.QueryTables.Add(Connection:=Array( _
"OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Password="""";Use
ID=Admin;Data Source=I:\Accounting\Inventory Files\" & intYear
"\Inventory " & Format(datDate, "m-dd-yyyy") & " wi" _
, _
"th Discounts.xls;Mode=Share Deny Write;Extende
Properties=""HDR=YES;"";Jet OLEDB:System database="""";Je
OLEDB:Registry Path="""";Je" _
, _
"t OLEDB
atabase Password="""";Jet OLEDB:Engine Type=35;Je
OLEDB
atabase Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet
_
, _
"OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Databas
Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encryp
Dat" _
, _
"abase=False;Jet OLEDB
on't Copy Locale on Compact=False;Je
OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False" _
), Destination:=Range("A1"))
.CommandType = xlCmdTable
.CommandText = Array("'Accounting EOM Inventory Report$'")
.Name = "Inventory " & Format(datDate, "m-dd-yyyy") & " wit
Discounts"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.SourceDataFile = _
"I:\Accounting\Inventory Files\" & intYear & "\Inventory "
Format(datDate, "m-dd-yyyy") & " with Discounts.xls"
.Refresh BackgroundQuery:=False
End With
Any help is appreciated,
Jorda
the VBA code has a big problem with the format function. I a
getting:
Microsoft Visual Basic
Compile Error
Wrong number of arguements or invalid property assignment.
With ActiveSheet.QueryTables.Add(Connection:=Array( _
"OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Password="""";Use
ID=Admin;Data Source=I:\Accounting\Inventory Files\" & intYear
"\Inventory " & Format(datDate, "m-dd-yyyy") & " wi" _
, _
"th Discounts.xls;Mode=Share Deny Write;Extende
Properties=""HDR=YES;"";Jet OLEDB:System database="""";Je
OLEDB:Registry Path="""";Je" _
, _
"t OLEDB

OLEDB

_
, _
"OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Databas
Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encryp
Dat" _
, _
"abase=False;Jet OLEDB

OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False" _
), Destination:=Range("A1"))
.CommandType = xlCmdTable
.CommandText = Array("'Accounting EOM Inventory Report$'")
.Name = "Inventory " & Format(datDate, "m-dd-yyyy") & " wit
Discounts"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.SourceDataFile = _
"I:\Accounting\Inventory Files\" & intYear & "\Inventory "
Format(datDate, "m-dd-yyyy") & " with Discounts.xls"
.Refresh BackgroundQuery:=False
End With
Any help is appreciated,
Jorda