View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Keyur Keyur is offline
external usenet poster
 
Posts: 1
Default code interferes with function charts()

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 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

--
Message posted from http://www.ExcelForum.com