That's better, you must have been selecting several cells.
That's better, you must have been selecting several cells.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Yep that's it, when selecting a row on the left side you automatically select multiple cells (all cells horizontal on that row).
So this solution helps indeed.
Thanks for your replies.
Hi, i get the same runtime error in my VBA macro. My code is below. now the funny thing is if I delete "StartInsTime" my code runs, but if I include it i get the runtime error. Any clues on how to resolve this?
![]()
With ActiveSheet.QueryTables.Add(Connection:=Array( _ "OLEDB;Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=Mscan100_db;Data Source=IntelDb2\MSSQL20" _ , _ "08;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=INTELDB2;Use Encryption for Data=False;Tag wi" _ , "th column collation when possible=False"), Destination:=Range("A1")) .CommandType = xlCmdSql '.CommandText = Array(sel_clause & frm_clause & whe_clause) .CommandText = Array( _ "SELECT DISTINCT " & "LotSn" & "," & "Orientation" & "," & "PanelSn" & "," & IP & "." & IPI & "," & "StartInspTime" & "FROM InspPasses Inner Join " & IPS & " ON InspPassSubstrates.InspPassID = InspPasses.InspPassID Inner Join" & Chr(10) & " InspRunSubstrates ON InspRunSubstrates.InspRunSubstID = InspPas" _ , _ "sSubstrates.InspRunSubstID Inner Join" & Chr(10) & " InspPassDefects ON ((InspPassDefects.hlp_SubstID = InspRunSubstrates.SubstID) AND (InspPassDefects.hlp_InspPassID = InspPasses.InspPassID)) Inner Join" & Chr(10) & " BT_DefectResultCode ON BT_Def" _ , _ "ectResultCode.DefectResultCodeID = InspPassDefects.DefectResultCodeID Inner Join" & Chr(10) & " InspRuns ON InspRuns.InspRunID = InspPasses.InspRunID Inner Join" & Chr(10) & " BT_InspRuns ON BT_InspRuns.BT_InspRunID = InspRuns.BT_InspRunID Inner Jo" _ , _ "in" & Chr(10) & " BT_Products ON BT_Products.ProdID = BT_InspRuns.ProdID Inner Join" & Chr(10) & " BT_DieCoordinates ON ((BT_DieCoordinates.DieNr = InspPassDefects.hlp_DieNr) AND (BT_DieCoordinates.SubstTypeID = BT_Products.SubstTypeID)) " & Chr(10) & " Where" _ , " InspPasses.InspPassID in ('8135')") .Name = "INTELDB2_MSSQL2008 Mscan100_db" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .PreserveColumnInfo = True .SourceConnectionFile = _ "C:\Documents and Settings\Valued Customer\My Documents\My Data Sources\INTELDB2_MSSQL2008 Mscan100_db.odc" .Refresh BackgroundQuery:=False End With End Sub
Last edited by dp1; 08-30-2012 at 09:58 PM. Reason: tags
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks