code interferes with function charts()

  • Thread starter Thread starter Keyur
  • Start date Start date
K

Keyur

hi

i want to add a query through code in excel spreasheet. the code i a
using is


With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=MS Acces
Database;DBQ=G:\Keyur\HFI_FE.mdb;DefaultDir=G:\" & _
"Keyur;DriverId=25;FIL=M
Access;MaxBufferSize=2048;PageTimeout=5;" _
, Destination:=Range("A8"))

.CommandText = Array( _
"SELECT tblCINLog.CIN, tblCINLog.Customer
tblCINLog.Preform, " & _
"tblCINLog.Defect, tblCINLog.DefectiveQty, tblCINLog.Date
& Chr(13) & _
"" & Chr(10) & "FROM `G:\Keyur\HFI_FE`." & _
"tblCINLog" & Chr(13) & _
"" & Chr(10) & "WHERE (tblCINLog.Date <= #" & Date & "#
AND (tblCINLog.Date >= #" & (Date - 30) & "#)" _
& Chr(13) & "" & Chr(10) & "ORDER BY tblCINLog.CIN")

.Name = "Query from MS Access Database_1"
.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


This code for some reason :confused: doesnt lets me use chart
function. Does anyone have a possible explanation and is there a way t
refers to charts in another way

Thank
 
sorry if you thought on this.

i am so embarrased it was such a stupid thing. i named my sub charts(
so obviously...

Thanks neway
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top